Copyright: GroundControl Help File Version 2.04


Web Site

You can find lots of great information from our Web Site. The latest news and downloads for our products, as well as answers to other customer’s questions. We also have information and links to other Internet sites that you might find of interest. We will be expanding this information constantly to provide the best possible Internet support to our customers.

www.acrasoft.com


Other Products

GroundControl works well with the award-winning LaunchPad from Cypress Technologies! LaunchPad is an automated scheduler, for launching programs based on a wide variety of conditions and triggers.

  LaunchPad


Disclaimer

This software (GroundControl) and all accompanying written materials are provided "as is" without warranty of any kind. Further,Acrasoft does not warrant, guarantee, or make any representations regarding the use, or the results of use, of the software or written materials in terms of correctness, accuracy, reliability, currentness, or otherwise. You assume the entire risk as to the results and performance of the software. If the software or written materials are defective, you, and not Acrasoft or its dealers, distributors, agents, or employees, assume the entire cost of all necessary servicing, repair, or correction.

The above is the only warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose, that is made by Acrasoft, on this Acrasoft product.

No oral or written information or advice given by Acrasoft, its dealers, distributors, agents or employees shall create a warranty or in any way increase the scope of this warranty and you may not rely on any such information or advice. You may have other rights, which vary, from state to state.

Neither Acrasoft nor anyone else who has been involved in the creation, production or delivery of this product shall be liable for any direct, indirect, consequential or incidental damages (including damages for loss of business profits, business interruption, loss of business information, and the like) arising out of the use or inability to use such product even if Geocel has been advised of the possibility of such damages.

This limited warranty shall be governed and construed in accordance with the laws of the state of California.

Acknowledgment

By using and/or installing GroundControl, you acknowledge that you have read this limited warranty, understand it, and agree to be bound by its' terms and conditions. You also agree that the limited warranty is the complete and exclusive statement of agreement between the parties and supersede all proposals or prior agreements, oral or written, and any other communications between the parties relating to the subject matter of the limited warrant


 Copyright

This program and its related documentation are copyright. The owner is Acrasoft. All rights reserved. You may not use, copy, modify, or transfer the programs, documentation, or any copy except as expressly provided in the licensing agreement.

© Acrasoft 1997, 1998


 Shareware Agreement

The shareware system and the continued availability of quality shareware products depend on your willingness to register and pay for the shareware you use. The registration fees you pay allow authors to support and continue to develop quality products.

As a software user, you benefit from this system because you get to try the software and determine whether it meets your needs before you pay for it.  You should carefully read the following terms and conditions before using this software.  Unless you have a separate written license agreement signed by Acrasoft, your use of this software indicates your acceptance of this license agreement and warranty.

GroundControl is covered by copyright. When you acquire GroundControl under this shareware arrangement, you are actually acquiring a license to use it, not own it. You acquire the license from Acrasoft.  Acrasoft allows purchasers to make and distribute copies of the software, but if, after testing the software, you adopt it for use, you must register it.

Registered Version

One registered copy of GroundControl may either be used by a single person who uses the software personally on one or more computers, or installed on a single workstation used nonsimultaneously by multiple people, but not both.  You may access the registered version of GroundControl through a network, provided that you have obtained individual licenses for the software covering all workstations that will access the software through the network.  For instance, if 8 different workstations will access GroundControl on the network, each workstation must have its own GroundControl license, regardless of whether they use GroundControl at different times or concurrently. Modifications to the software are not allowed.  Decompiling (i.e., reverse engineering) of the program code, or development of new works built upon the package (derivative works) are not allowed without expressed written permission of Acrasoft.  You can make archival copies, but you are required to pay for all copies adopted for use.


Product Support

Product Support for GroundControl is available through one of the following:

Web Site: www.acrasoft.com

You can find lots of great information from our Web Site. The latest news for our products as well as question and answers. We also have information and links to other Internet sites that you might find of interest. We will be expanding this information constantly to provide to best stop for Product information to serve our customers.

Email support can be sent to one of the following address:

Internet 	Direct questions to: Support	support@acrasoft.com

You can also write us at the following address:	Acrasoft

4450 California Ave. #278

Bakersfield, CA. 93309


Application Overview

GroundControl is a full-featured tool that lets you build your own macro files to easily automate tasks on your computer. You have at your disposal over 90 functions to do everything from basic Window controls to the more advanced DDE and SendKeys features. You use the Wizard to add commands to the macro window instead of typing them all in, or use the toolbars to add commands at the click of a button.  GroundControl handles the syntax and structure.  GroundControl has advanced registry and file functions.  Also, powerful variables functions so you can manipulate data with ease  This makes GroundControl the fastest and easiest way to get your computer working for you more effectively.

GroundControl saves each macro you write as a single file, and you can run other macro files from inside any given macro file. This means you can specialize your macros for certain tasks ( like subroutines ) and keep your files small. Using the flow control statements , you can make real-time decisions to launch those tasks or not. GroundControl comes with a full set of file functions, and a strong suite of diagnostic functions to monitor disk space and memory, track and log errors, etc.

GroundControl is not just a blind batch file - it comes with functions for user interaction through message boxes , question boxes, and input boxes. This means you can use GroundControl as a front end for other applications you don't want users to have access to, especially if you take advantage of the SendKeys and DDE functions.

All in all, GroundControl is a powerful instrument that is easy to use, easy to maintain, and far-reaching in its capabilities.


ActivateWindow

ActivateWindow(<window title>)

ActivateWindow brings a window to the foreground and makes it the active window.

Parameters: 	window title - Specifies the name of the window to make the active window.

Returns:	TRUE if successful; otherwise FALSE.

Use ActivateWindow  to bring a running application window to the front so it can receive action from the macro.  The window title is not just simply the application name. For example if you were editing a text file called README.TXT in NotePad the window title would be “README.TXT - Notepad”.  GroundControl provides a browse button that will display a list of the window titles for all the currently running applications.  If the window you need is not in the list, you can either type the window title in manually, or close the selection box, execute the application you need and then click the browse button again.  This time the list will include the window title you need.  Select it and click the OK button.

If the window is iconized when you execute this statement, it will be restored to its normal position.

Examples:

ActivateWindow("Untitled - Notepad")

ActivateWindow("Microsoft Word - Document1")

Also See:

  FindWindow

  WindowActive

  CloseWindow

  RunProgram


SendKeysToWindow

SendKeysToWindow(<window title>,<keys>)

SendKeysToWindow brings a window to the foreground and makes it active, then sends keystrokes to it.

Parameters:	window title - Specifies the name of the window to make the active window and send keys to.

keys - Specifies the keystrokes to send to the activated window.

Returns:	TRUE if successful; otherwise FALSE.

Sending keys can be can be fraught with danger if you are not sure which open application is going to be active and receive the keystrokes.  By using the SendKeysToWindow command you can bring a running application window to the front so it can receive the keystrokes from the macro.  The window title is not just simply the application name. For example if you were editing a text file called README.TXT in NotePad the window title would be “README.TXT - Notepad”.  GroundControl provides a browse button that will display a list of the window titles for all the current running windows.  If the window you need is not in the list, you can either type the window title  in manually,  or close the selection box, execute the application you need and then click the browse button again.  This time the list will include the window title you need.  Select it and click the OK button.

If the window is iconized when you execute this statement, it will be restored to its normal position.

You can also specify a delay between each character in the system Options dialog.

Examples:

SendKeysToWindow("Untitled - Notepad",”This is a test”)

Also See:

  SendKeys Overview

  Key Codes

  ActivateWindow

  SendKeys

  FindWindow

  System Options


CloseWindow

CloseWindow(<window title>)

CloseWindow closes a window based on its title.

Parameters: 	window title - Specifies the name of the window to close.

Returns:	TRUE if successful; otherwise FALSE.

CloseWindow is not the opposite of ActivateWindow . CloseWindow is the same as clicking the close box in a window. CloseWindow, in most cases, quits the application.  If there are unsaved open documents in an application you try to close, those applications will most likely display dialog boxes to prompt you to save changes before closing, this will prevent the window from closing until those dialogs are answered either manually or by using SendKeys .  The window title is not just simply the application name. For example if you were editing a text file called README.TXT in NotePad the window title would be "README.TXT - Notepad".  GroundControl provides a browse button that will display a list of the window titles for all the current running windows.  If the window you need is not in the list, you can either type the window title in manually,  or close the selection box, execute the application you need and then click the browse button again.  This time the list will include the window title you need.  Select it and click the OK button.

Examples:

CloseWindow("Untitled - Notepad")

CloseWindow("Microsoft Word - Document1")

Also See:

  ActivateWindow

  QuitProgram


MessageBoxOkCancel

MessageBoxOkCancel(<message>)

MessageBoxOkCancel creates a simple message box with text you specify, plus an OK button and a Cancel button. The button clicked (or the response) is captured by the ResponseOk or ResponseCancel functions.

Parameters:	message - Specifies the text that will be displayed in the message box  prompt.

MessageBoxOkCancel  enables you to display a message to the screen. The execution of the macro stops until the OK or Cancel button is clicked. The button that is clicked is captured in the ResponseOk or ResponseCancel functions. You can then check to see which button was clicked by using an If statement, and execute different commands based on the user's response.

Examples:

MessageBoxOkCancel("File not found. Press OK to continue or Cancel to quit macro")

If(ResponseCancel(),ExitMacro())

Also See:

  ResponseOk

  ResponseCancel

  MessageBox

  InputBox


ResponseOk

ResponseOk()

Parameters:	None.

Returns:	TRUE if the last message box was closed with the Ok button, FALSE if not.

ResponseOk is a function used after a MessageBox , MessageBoxOkCancel , or InputBox in an If statement to detect which key the user clicked to exit the dialog. This function simply checks the response from the last 'MessageBox type' command. This allows you to change the execution of the macro based on that response.

Examples:

InputBox("Enter Your Name:")

If(ResponseOk(),RunProgram("Notepad.exe"))

Delay(1000)

If(FindWindow("Untitled - Notepad"),SendInputToWindow("Untitled - Notepad")

Also See:

  If

  MessageBox

  MessageBoxOkCancel

  InputBox


FindWindow

FindWindow(<window title>)

FindWindow is used in an If condition to check if a window is open.

Parameters:	window title - Specifies the name of the window to look for.

Returns: 	TRUE if there is a window that has a title that matches the passed window title

Use FindWindow  to determine if an application window is running. FindWindow will find a window even if it is not the 'active window.' FindWindow supports wildcards, so you can specify a partial window name, and GroundControl will determine if a window exists which matches the wildcard.

Wildcard formats work just like DOS file wildcards. If you’ve ever typed “dir a*.txt” to get a list of all .txt files beginning with “a”, or “delete *.b?” to remove all files ending with a two digit extension, first letter “b”, then you know what these are all about. GroundControl comparisons are case sensitive:

?	represents a single character

*	represents multiple characters after the *

FindWindow(“Untitled - Notepad”) will only return TRUE if the program “Untitled - Notepad” is found.

FindWindow(“C*”) will return TRUE if either “Calculator” or “Character” is running, but not “clipboard” (“c” vs “C”).

FindWindow(“a??”) will return TRUE if either “abc” or “aka” are running, but not “abcdefg” ( too many letters ).

Use the * to represent the remainder of a window, not the start. For example:

FindWindow(“Untitled - Note*”)

will find “Untitled - Notepad”, “Untitled – Notepad+”, and “Untitled - Notebook”. However:

FindWindow(“*- Notepad”)

Will find "Untitled - Notepad"

FindWindow wildcards work the the same way DOS wildcards work.

Examples:

If(FindWindow("Untitled - Notepad"), SendKeysToWindow("Untitled - Notepad","This is a test")

Also See:

  ActivateWindow

  WindowActive

  CloseWindow

  RunProgram


WindowActive

WindowActive(<window title>)

WindowActive is used in an If condition to check if a window is the current active window.

Parameters:	window title - Specifies the name of the window to check for.

Returns:	TRUE if the current active window title matches the passed window title

Use WindowActive  to determine if an application window is the 'active window.'  Because SendKeys always sends keystrokes to the active window, you could use this command before a SendKeys command to be sure the keys are sent to the window you want. Of course, if the keys you send are constantly changing which window is active, you could use the SendKeysToWindow function instead, and not worry about using ActivateWindow over and over again.

Examples:

If(WindowActive("Untitled - Notepad"), SendKeys("This is a test"))

Also See:

  ActivateWindow

  CloseWindow

  RunProgram


SetDirectory

SetDirectory(<directory>)

SetDirectory changes the current directory.

Parameters:	directory - Specifies the name of the directory.

Use SetDirectory to change the current working directory to another directory on your system.  The current working directory where GroundControl will look for files if you don't specify a full path.  If you use the command WriteLineToFile("This is a test","MyFile.txt") GroundControl would look for 'MyFile.txt' in the current working directory.  If the file is not there the WriteLineToFile command would create 'MyFile.txt' in the current working directory.

Examples:

SetDirectory("c:\temp")

SetDirectory("c:\My Documents")

Also See:

  LogToFile

  WriteToFile

  WriteLineToFile


LogError

LogError(<message>)

LogError writes an entry in the error log file

Parameters:	message - Specifies the text to be written to the log file.

Use LogError to write custom error messages with a time and date stamp to the default log file, called macerr.log. Your macro can handle errors and post messages to the error log based on conditions in the macro. This is useful for tracing automated jobs. The log file looks something like this:

01/24/97 19:50:20 User said no to my dialog box

01/24/97 19:50:25 The Calculator program wasn't running.

If you want to use LogError as a means to trace program execution, but you don't want to clutter the error log with general messages, you can use LogEvent, which does exactly the same thing, but to a different file. You can also use LogToFile, which lets you specify which file to write the message to. This means you can have many different logfiles, each for different purposes.

Examples:

If(FileExist("C:\WIN95\win.ini"),Beep(),LogError("File Not found"))

Also See:

  WriteToFile

  WriteLineToFile

  LogToFile

  LogEvent


FileExist

FileExist(<file name>)

FileExist checks to see if the specified file exists.

Parameters:	file name - Specifies the name of file to check for.

Returns: 	TRUE if file is found; otherwise FALSE.

Use this command to check if a file exists. The application will look in the path defined for the file name. If that file is found, then the command returns TRUE. A good use for this command might be to check for a file before moving it to a backup directory.

This command supports wildcards. The wildcards are your typical DOS wildcards ( * = multiple characters, ? = a single character ). For example:

*.*	all files

*.txt	all txt files.

*.F?	all files with 2 character extentions starting with “F”

*.F*	all files with any extension starting with “F”

a*.*	all files starting with “a”

a??.*	all files with three letter names starting with “a”, and any extension.

Note that FileExist does not inform you of the file’s locked status. If the file is locked by a process, you will not be able to copy, move, delete, open, etc the file. Use IsFileLocked to test for this condition.

If you actually want to search for a file in multiple paths, use FindFile .

Examples:

If(FileExist("C:\WIN95\win.ini"),Beep(),LogError("File Not found"))

Also See:

  WriteToFile

  WriteLineToFile

  SetDirectory

  IsFileLocked

  FindFile


SetCaption

SetCaption(<caption>)

SetCaption set the window titles for macro dialogs

Parameters:	caption - Specifies the text for the macro window titles.

Use SetCaption to customize the dialog titles in your macro.  SetCaption sets the title text for the MessageBox and InputBox dialogs. It is visible for all the dialogs after that until you change it again.

Examples:

SetCaption("Going Once")

If(MessageBoxOkCancel("Do you want to run the daily backup?"),GoTo(":DoBackup"),Beep())

SetCaption("Going Twice")

If(MessageBoxOkCancel("How about the disk defragmenter instead?"),GoTo(":DoBackup"),Beep())

Also See:

  MessageBox

  MessageBoxOkCancel

  InputBox


Delay

Delay(<milliseconds>)

Delay pauses the execution of the macro for a specified number of milliseconds

Parameters:	milliseconds - Specifies the number of milliseconds to wait.

Use Delay to pause GroundControl before executing the next command. A millisecond is one thousandth of a second, so to pause a macro for ten seconds you would need to specify 10,000 milliseconds in the Delay parameter.

1 second = 1,000 ms

1 minute  = 60,000 ms

1 hour     =  3,600,000 ms

Technically, Delay suspends the GroundControl thread for the specified timeout. If you want to delay GroundControl until after another program has finished executing, use WaitForProgram . You can only use WaitForProgram if you started the other program yourself with RunProgram.

Examples:

RunProgram("WordPad.exe")

Delay(5000)

SendKeys("This is some text")

See Also:

  WaitForProgram


QuitProgram

QuitProgram(<window title>)

QuitProgram closes a window based on its title.

Parameters:	window title - Specifies the name of the window to close.

Returns:	TRUE if successful; otherwise FALSE.

QuitProgram is essentially the same as CloseWindow. QuitProgram quits (or exits) the application specified.  If there are unsaved open documents in an application you try to close, those applications will most likely display dialog boxes to prompt you to save changes before closing. This will prevent the window form closing until those dialogs are answered either manually or by using SendKeys.  The window title is not just simply the application name. For example if you were editing a text file called README.TXT in NotePad the window title would be "README.TXT - Notepad".  GroundControl provides a browse button that will display a list of the window titles for all the current running windows.  If the window you need is not in the list, you can either type the window title in manually, or close the selection box, execute the application you need and then click the browse button again.  This time the list will include the window title you need.  Select it and click the OK button.

Examples:

QuitProgram("Untitled - Notepad")

QuitProgram("Microsoft Word - Document1")

Also See:

  ActivateWindow

  CloseWindow


RebootSystem

RebootSystem()

RebootSystem executes a system reboot.

Parameters:	None.

The RebootSystem  command will shut down and then restart Windows. the computer will go to one of the following states:

Windows 95:	Exits Windows, then restarts the computer and Win95.

Windows NT:	Exits Windows, then restarts the computer and WinNT.

Normally if any program running requires confirmation before exiting, you would be required to respond to all the "Save Changes ..." dialogs before the applications will shutdown. You should try to close all the running windows before you execute this statement.

Examples:

If(FileExist("c:\temp\error.txt","RebootSystem()")

Also See:

  Logout

  ShutDownSystem

  QuitProgram


ShutdownSystem

ShutdownSystem()

ShutdownSystem executes a system shutdown.

Parameters:	None.

This command will shut down Windows. The computer will go to one of the following states:

Windows 95:   The "It's now safe to turn off your computer" screen.

Windows NT:  The "Shutdown or Restart Computer" dialog.

Normally if any program running requires confirmation before exiting, you would be required to respond to all the "Save Changes ..." dialogs before the applications will shutdown. You should try to close all the running windows before you execute this statement.

Examples:

MessageBoxOkCancel("Do you want to perform a system shutdown?")

If(ResponseOk(),ShutdownSystem())

Also See:

  Logout

  QuitProgram

  Logout

  RebootSystem


Logout

Logout()

Logout executes a system logout.

Parameters:	None.

This command will attempt to close all open applications and Logout of the current Windows session. The computer will go to one of the following states:

Windows 95:   Windows Login dialog.

Windows NT:  The "Press Ctrl, Alt, and Delete to login" dialog.

Normally if any program running requires confirmation before exiting, you would be required to respond to all the "Save Changes ..." dialogs before the applications will shutdown.

Examples:

Logout()

Also See:

  ShutdownSystem

  ReBootSystem

  QuitProgram


RunMacro

RunMacro(<macro file name>)

RunMacro runs another macro file and then resumes execution.

Parameters:	macro file name - Specifies the name of the macro file to run

The RunMacro command enables you create reusable macros.  Once you write a macro that performs a particular function (i.e. backup files) then you do not have to duplicate that macro again and again within every macro you write later. You can use the RunMacro command to run existing macros.  It is feasible to have one macro that only runs other macros based on certain conditions.  To use the RunMacro command type the path and file name of the macro you want to run or you can use the Browse button to locate the macro file.

Examples:

If(FileExist("C:\WIN95\Calc.exe"),RunMacro("C:\Program Files\GroundControl\test2.grn"),Beep())

Also See:

  RunProgram

  ExitMacro

  If


Beep

Beep()

Beep sounds the system beep.

Parameters:	None.

Beep plays the default system beep.

Examples:

If(FileExist("C:\WIN95\win.ini"),Beep() )

Also See:

  PlaySound


PlaySound

PlaySound(<wave file name>)

PlaySound plays a wave file.

Parameters:	wave file name - Specify the sound (.wav) file to be played

PlaySound enables you to customize the way your macro sounds. Type the name of the .WAV file or use the Browse button to locate the file you want play.

Examples:

PlaySound("C:\WIN95\MEDIA\Chord.wav")

Also See:

  Beep


RunProgram

RunProgram(<program>,<mode>)

RunProgram executes a program

Parameters:	program - The command line for the program to run

mode – optional paramter specifying how to run the program

Returns: 	TRUE if successful; otherwise FALSE.

The RunProgram command is used to run a program. The parameter is any valid program. The parameter can also be a document, if so, RunProgram will launch the associated program and open the document. Associations can be defined for any file extension on Windows NT or 95 interface through the Explorer under (View)(Options)(File Types). In NT 3.51, you define associations through the File Manager under (File)(Associate).

The mode parameter can be one of the following. If not specified, “NORMAL” is assumed:

Normal - program comes up as though launched from the Start menu while file is printing

Maximized - program comes up and fills up entire screen while file is printing

Minimized - program comes up and runs as an icon while file is printing

Hidden - program runs, but no icon or main window is visible while file is printing

These modes are the same as used by the Print command.

Examples:

RunProgram("c:\winnt\notepad.exe c:\autoexec.bat")

RunProgram("http://www.acrasoft.com")

RunProgram("myfile.doc")

Also See:

  RunMacro

  WaitForProgram

  Print


SendKeys

SendKeys(<keys string>)

SendKeys sends keystrokes to the active window.

Parameters:	keys string - Specifies the keys to send.

Returns:	TRUE if successful; otherwise FALSE.

Use ActivateWindow  to bring a running application window to the front so it can receive action from the macro.  The window title is not just simply the application name. For example if you were editing a text file called README.TXT in NotePad the window title would be "README.TXT - Notepad".  GroundControl provides a browse button that will display a list of the window titles for all the current running windows.  If the window you need is not in the list, you can either type the window title in manually, or close the selection box, execute the application you need and then click the browse button again.  This time the list will include the window title you need.  Select it and click the OK button.

If the window is iconized it will be restored to its normal position.

You can also specify a delay between each character in the system Options dialog.

Examples:

RunProgram("c:\winnt\notepad.exe")

Delay(2000)

SendKeys("This is an example of keys sent to notepad~")

Also See:

  SendKeys Overview

  Key Codes

  SendKeysToWindow

  RunProgram

  ActivateWindow

  System Options


ResponseCancel

ResponseCancel()

Parameters:	None.

ResponseCancel is a function used after a MessageBox, MessageBoxOkCancel, or InputBox to detect which key the user clicked to exit the dialog. This functions simply holds the response from the last 'MessageBox type' command. This allows you to check which button a user clicked and continue the execution of the macro base on that response.

Examples:

MessageBoxOkCancel("File not found. Press OK to continue or Cancel to quit macro")

If(ResponseCancel(),ExitMacro(),)

Also See:

  If

  MessageBox

  MessageBoxOkCancel

  InputBox


InputBox

InputBox(<prompt>,<variable name>)

InputBox create a dialog box to prompt user for input

Parameters:	prompt - text to prompt user

variable name – optional variabel to store response in

InputBox is used to prompt a user for input.  Whatever the user types is stored internally to GroundControl in a buffer. The buffer can then be sent as keystrokes using the SendInput command.

The optional variable name is another way of storing the user’s input. If no variable is specified, the input is saved only in the internal buffer and can only be used by the SendInput function. If a variable is specified, the input is copied there also, and can then be used by ANY of GroundControl’s functions.

You can use SetCaption to customize the dialog title:

Examples:

ActivateWindow(“Untitled - NotePad”)

SetCaption("Personal Info")

InputBox("Enter your name:")

//send your name to notepad

SendInput()

// this stores the answer in %N

InputBox(“What is your name”,%N)

MessageBox(%N)

Also See:

  SendInput

  SendInputToWindow

  MessageBox

  MessageBoxOkCancel

  SetCaption


SendInputToWindow

SendInputToWindow(<window title>)

SendInputToWindow send the text input from an InputBox command as keystrokes

Parameters:	window title - title of window to send text to

SendInputToWindow is used to send the text that was input from the user in the InputBox command.  The text is sent as keystrokes to the window specified.

Examples:

InputBox("Enter your name:")

SendInputToWindow("Untitled - Notepad")

Also See:

  InputBox

  SendInput


If

If(<condition>,<command if TRUE>[,<command if FALSE>])

If is a condition tester that can be used to control program flow

Parameters:	condition - Specifies the conditional statement that is evaluated

command if TRUE - The command that is executed if the conditional statement returns TRUE

command if FALSE - The command that is executed if the conditional statement returns FALSE

The If command is used to control program flow. The <condition> parameter can be any command that returns TRUE or FALSE.  Almost all GroundControl commands can be used. The <command if TRUE> parameter is the command that will be executed if the condition returns TRUE. It can be any valid command. You may also nest If commands.  The <command if FALSE> parameter is the command that will be executed if the condition returns FALSE. This parameter is optional. If this parameter is omitted and the condition returns FALSE, program execution will continue on the next line.

Examples:

// this if statement uses three parameters

MessageBoxOkCancel("Do you want to continue?")

If(ResponseOk(),GoTo(":process"),ExitMacro())

:process

LogToFile("c:\test.log","Processing....")

// this if statement uses only the first two parameter

If( FileExist("c:\autoexec.bat"),MessageBox("Old system settings found"),)

Also See:

  GoTo


LogToFile

LogToFile(<file name>,<string to log>)

LogToFile writes a string to a specified file with a time-date stamp. This is useful for tracking errors and events, and making sure that certain routines are being executed, etc. It works the same as LogError and LogEvent, but you specify your own log file instead of the system default “macerr.log”.

Parameters:	file name - name of the file to write to.

String - the string you want to write.

Examples:

LogToFile("f:\gc\mylog.txt","This is before the delay")

Delay(10000)

LogToFile("f:\gc\mylog.txt","This is after the delay")

The results look like this ( note the times ):

01/24/97 20:32:12 This is before the delay

01/24/97 20:32:22 This is after the delay

See Also:

  LogError

  LogEvent


WriteToFile

WriteToFile(<file name>,<text>)

WriteToFile writes a string to a file

Parameters: 	file name - The file name to write

text - The text to write to the file

Returns:	TRUE if successful; otherwise FALSE.

The WriteToFile command writes text to a file. If the file name specified does not exist, it will be created. The text is appended to the file without a carriage return. To write a line to a file with a carriage return use the command WriteLineToFile.

Examples:

The following macro:

WriteToFile("f:\gc\x.txt","Hello my name is ")

WriteToFile("f:\gc\x.txt","John. ")

WriteToFile("f:\gc\x.txt","How are you?")

Produces the following in file x.txt:

Hello my name is John. How are you?

Compare this with the example given for WriteLineToFile

Also See:

  WriteLineToFile

  LogError

  LogToFile


WriteLineToFile

WriteLineToFile(<file name>,<text>)

WriteLineToFile writes a string to a file with a carriage return appended.

Parameters	file name - The file name to write

text - The text to write to the file

Returns:	TRUE if successful; otherwise FALSE.

The WriteLineToFile command writes text to a file. If the file name specified does not exist, it will be created. The text is appended to the file without with a carriage return. To write a line to a file without a carriage return use the command WriteToFile.

Examples:

The following macro:

WriteLineToFile("f:\gc\x.txt","Hello my name is ")

WriteLineToFile("f:\gc\x.txt","John. ")

WriteLineToFile("f:\gc\x.txt","How are you?")

Produces the following file:

Hello my name is

John.

How are you?

Compare this with the example given for WriteToFile.

Also See:

  WriteToFile

  LogError

  LogToFile


ExitMacro

ExitMacro()

Parameters:	None.

ExitMacro is used to end the execution of a macro immediately.

Examples:

OnError(":error")

// your macro commands

LogToFile("mylog.txt","Macro completed successfully")

ExitMacro

:error

LogError("Macro failed")


Tease Me Now!

Let's write a very quick, easy macro that beeps and shows a MessageBox that says “Hello, world!”. (This is the first program that almost everybody writes, so don’t scoff if you think it’s too easy!). Start with an empty file, and use the View menu to hide all the toolbars except the "Common" toolbar. Now lets get started:

Click on the little horn icon. This adds a line that looks like Beep() to the macro. Click it again if you want, and you'll beep twice. You won't hear them until you run the macro, though.

Now move the mouse along the toolbar until you see the "MessageBox" tip. It's the second tool from the end. When you click this, you get a dialog box that has MessageBox on the “Commands” line, but nothing in the “Message Text” line. Type "Hello, world!" into the second box and hit OK. Your macro should now look like this:

Beep()

MessageBox("Hello, world!")

Now look to the right where  to the "Run" button is and press it. Your macro should beep, and show a message box saying “Hello, world!”. You can save this macro by selecting "File" and "Save As" from the main menu just like you would any other document.

To get a taste of what functions are available, check out the Function by Category section. There are about fifty statements you can execute, and with loops and branches, you can organize them in an infinite number of ways! You can get write message boxes that ask for information, and manipulate other programs via SendKeys and DDE.

Also See:

  How Do I


Function Descriptions by Category

There are around 65 functions in the basic GroundControl package. Many of them are self-descriptive and obviously can be used alone, for example: Beep(). Others are more complicated and need to be used in the context of other functions, like OnError() or While().

The following sound functions can be used to add audible alarms or make your macro more interactive:

Beep 	Beep a single tone

PlaySound 	Play a .wav file

Print 	Print any file

The next group allows you to manipulate already open windows. As long as you know the title bar of the window you want to control, you can use any of these functions:

ActivateWindow 	Make the specified window active ( bring to top )

CloseWindow 	Close the specified window

MinimizeWindow 	Minimize the active window

MaximizeWindow 	Maximize the active window

NormalizeWindow	Put active window back in normal position ( de-maximize or de-minimize )

FindWindow 	Returns true if specified window is open ( not necessarily active )

WindowActive 	Returns true if specified window is active ( on top )

You can start and stop programs with the following tools:

RunMacro 	Starts another macro file, then comes back to the original file

ExitMacro 	Stops the currently executing macro

RunProgram 	Starts an application

QuitProgram 	Sends an exit command to the specified window

RunDOSCommand 	Executes a DOS command

WaitForProgram 	Waits for the program started with RunProgram to exit

You can shutdown the system in a variety of ways:

Logout 	Log the current user out

PowerOff 	Power the system down ( for laptops )

RebootSystem 	Shutdown with restart

ShutdownSystem 	Shutdown without restart

There are functions for changing flow control:

If 	Checks a return value, and executes one of two options.

Repeat 	Repeats a function for a specified number of times

Delay 	Pauses for a specified time

While 	Loops while a condition is true

OnError 	Defines where to jump to if an error occurs

You can jump around in a macro using GoTo and labels, and use comments to skip over code.

GoTo 	Jump to a specified label, e.g.: GoTo(":Jail")

:label 	Defines a label, e.g.: ":Jail"

Comment 	Defines a line of code to be ignored, e.g., “//PowerOff()”

There are functions to monitor system resources and provide diagnostics:

FileExist 	Checks if the specified file exists, accepts wildcards

IsFileLocked 	Checks if the specified file is locked by a process

FileOlderThan 	Checks the date of a file against a specified date

LogError 	Writes a time-stamped message to the GroundControl error log file

LogSystem 	Writes a time-stamped system resource value into a specified logfile

SetDirectory	Changes the current working directory

File functions are provided by:

FindFile 	Search a path for a specified file

MoveFile 	Moves a file from one path to another

CopyFile 	Copies a file from one path to another

DeleteFile 	Deletes a specified file

WriteLineToFile 	Write a single line of text to a file ( with carriage return )

WriteToFile 	Write a piece of text to a file ( without carriage return )

LogToFile 	Write a message to a file with time and date stamp ( with carriage return )

These file functions are for scrolling through a text file one line at a time.

OpenFile 	Open a file for reading lines from.

CloseFile 	Close a file previously opened for reading

ReadLine 	Read the next line of text from a file into a variable

User interaction is provided by:

SetCaption 	Change the caption of all the dialogs from this point forward

MessageBox 	Show a message box ( with an OK button only )

MessageBoxOkCancel 	Show an OK/Cancel message box, and return which was pressed

ResponseOk 	Checks if the last MessageBox was closed with the Ok button

ResponseCancel 	Checks if the last MessageBox was closed with the Cancel button

New features exist for working with directories:

CreateDirectory 	Creates a directory in a specified path

RemoveDirectory 	Removes a directory in a specified path

New features exist for working with variables:

IfLessThan 	Compares a system resource against a numerical value and takes action

IfMoreThan 	Compares a system resource against a numerical value and takes action

IfEquals 	Compares two variables or resources and takes action

Dump 	Displays the contents of all variables in a dialog box

PutVar 	Writes a string or number into a variable

Increment 	Adds “1” to the value of a variable

Decrement 	Subtracts “1” from the value of a variable

AddString 	Appends one string to another

In conjunction with variables, there are some formulas for accessing the registry and ini files, the clipboard, and system resources.

GetSystem 	Reads a system resource into a variable

GetClipBoard 	Reads the clipboard into a variable

GetFileSize 	Reads a file size ( bytes ) into a variable

GetFileDateTime 	Reads the file change date/time into a variable

GetFromRegistry 	Reads a registry entry into a variable

GetFromIniFile 	Reads an ini file entry into a variable

WriteToRegistry 	Writes a variable to a registry entry ( persistent storage )

WriteToIniFile 	Writes a variable to an ini file entry ( persistent storage )

GroundControl manipulates dates and time fairly easily:

GetDate 	Returns current system date into a variable.

GetTime 	Returns current system time into a variable.

GetDateTime	Returns formatted date and/or time into a variable.

IsDateAfter 	Compares two dates and returns TRUE/FALSE

IsDateBefore 	Compares two dates and returns TRUE/FALSE

IsDateEqual 	Compares two dates and returns TRUE/FALSE

IsDateBetween	Compares two dates and returns TRUE/FALSE

IsTimeAfter 	Compares two times and returns TRUE/FALSE

IsTimeBefore	Compares two times and returns TRUE/FALSE

IsTimeEqual 	Compares two times and returns TRUE/FALSE

IsTimeBetween 	Compares two times and returns TRUE/FALSE

A powerful extension of GroundControl is the SendKeys function set, which sends a piece of text to a window as individual keystrokes. You can send individual keys, ask for a line of text from the user and send that, or send one of the environment or system variables. If you are sending lots of keystrokes, you would want to ActivateWindow() first. SendKeys can be tricky if you "misplace" the active window, but it allows you to control a program remotely as though you were actually there clicking menus and typing into dialogs.

SendKeys 	Send a line of text to the active window

SendKeysToWindow 	Send a line of text to the specified window

InputBox 	Ask for a line of text, and store in the input buffer

SendInput 	Send the input buffer to the active window

SendInputToWindow 	Send the input buffer to the specified window

SendEnvironment 	Send an environment variable to the active window

SendNow 	Send the current time to the active window

SendKeysFromFile 	Send the contents of a file as keystrokes.

SetCapsLock 	Set the CAPS key to On or Off.

MouseClickScreen 	Send a mouse click to specified coordinates.

MouseDblClickScreen 	Send a double click to specified coordinates.

The other extension to GroundControl is the DDE function set, which allows you to send messages to other programs, including those on other workstations if you are part of a network. DDE can be complicated and it requires you know the proper syntax understood by the program you are trying to communicate with. If you are running on a network, you may also have to preconfigure the DDE shares on the host system. On the other hand, a well written DDE server will make program control much cleaner and robust than SendKeys because DDE is not dependent on activating windows and making sure that the text you send goes to the right place.

DdeCommand 	Send a single DDE command to an application and topic

DdeScript 	Send multiple DDE commands from a file to an application and topic

DdeOpen 	for opening a converation

DdeClose 	for closing a conversation

DdeRead 	for reading a value from the server


Loop and Branches

Your first GroundControl program will probably be a simple series of commands that are executed from top to bottom, but as you probably can imagine, a really useful program is one which makes decisions, either independently of the user, or based on user input. This section explains how to use branches and loops effectively.

As an example, let's write a program that beeps ten times in a row. The first pass might be ( and don't laugh ):

Beep()

Beep()

Beep()

Beep()

Beep()

Beep()

Beep()

Beep()

Beep()

Beep()

This takes up lots of space and looks quite silly. The better way is to use a Repeat():

Repeat( Beep(), 10 )

The stuff in the middle is executed 10 times. The value of counter starts at one, and  increases by one each time until it reaches ten, where the loop exits. In our example, suppose we wanted to beep ten times ( decabeep, or decibeep? ), but play a sound clip and wait five seconds after each. GroundControl's repeat loop only lets you repeat one statement. Thus, without knowing better, we could write this:

Beep()

PlaySound("WHITEZON.WAV")

Delay(5000)

Beep()

PlaySound("WHITEZON.WAV")

Delay(5000)

... and so on eight more times. What we need is a repeat that takes more than one function as a parameter. "But wait, ", you cry, "this is impossible!. Did not Aristotle decree it was so?". "Ah, grasshopper, ", we respond smugly, "watch as we shine light where there was only darkness".

If we put the first three statements into a macro file and save them as "NOTIFY.gc", we can call them like this from our main macro:

Repeat( RunMacro("NOTIFY.gc"), 10 )

We have turned the three statements into a subroutine that can be called anywhere by anyone. We have used the repeat function to run the other macro file ten times. You should now realize how powerful the technique of subroutines and loops are, and how they can be used together for almost infinite flexibility. If you need a For-Next loop, use this concept.

The next section shows some other useful techniques for looping that accommodate situations that the Repeat loop can't.

  Improved Branching


Improved Branching

Suppose we have a situation where we want to beep to notify us that a file exists. Pretend that FLAG.DAT is a file that shows up on the network Q drive intermittently, and we want to hear an audible alarm when the file is there. The Repeat won't work because we don't know how many times to repeat the beep. We can use a While loop instead:

While( FileExist( "Q:\FLAG.DAT" ), Beep() )

This might look like the solution, but in actuality, there are two problems. The above code will produce a siren, because the While loop executes as fast as it can as long as the condition is true. We will have a steady stream of beeps until the file goes away. It would be better to check the file only once a minute. By the way, if you test the above line, you'll see what we mean by siren. Be prepared to press CTRL-ALT-DELETE and end the GroundControl task to make it go away!.

The other problem is that if the file doesn't exist when we run this program, the loop exits immediately, and the macro continues with the statements following the While line. We need a condition to stay true all the time. A good way of doing this is to look for a program or window that is always there, and the best candidate is GroundControl! Seriously, you can't run macros without it, can you? Let's use the subroutine concept, and write two files: This is main.gc:

While( FindWindow( "main.gc - GrndCntl", RunMacro("beep.gc"))

And this is beep.gc:

If( FileExist("Q:\FLAG.DAT"),Beep(),)

Delay(1000)

You can test these by running main.gc, and using a DOS box to create and delete the signal file.

So far you have looked at loops. Here we introduce the If and GoTo branch combination to you. These are actually the easiest pair to use and understand, but they do have a drawback: If you don't plan your labels and jumps properly, your macro will hop all over the place and you will be hard pressed to follow it around. GoTo statement have earned a nasty reputation as being responsible for the proliferation of "spaghetti code". Actually, tracing GoTo statements is what led to the rise of C++ Programming, the spread of cholera, and the Second Punic War. Anyway, here's how to write the beep code for our example:

:Start

// wait a minute then check the file ad infinitum

Delay(60000)

If( FileExist( "Q:\FLAG.DAT" ), Beep() )

GoTo(":Start")

This doesn't look too bad. Suppose instead of beeping, we wanted to beep, play a sound file recording of "The flag file is here again, m'sieur", and log a message recording the fact for posterity to C:\FLAG.LOG. If the flag file isn't there, we just want to play a different sound clip and log a different message. Furthermore, if a file called Q:\KEEPGOING.DAT showed up on the network, we want to quit hanging around waiting for the first file, and get on with the rest of the macro. We can use If and GoTo like this:

:Start

If( FileExist( "Q:\KEEPGOING.DAT" ), GoTo(":Done"), )

Delay(60000)

If( FileExist( "Q:\FLAG.DAT" ), GoTo(":FileHere"), GoTo(":NoFile")  )

GoTo(":Start")

:FileHere

Beep()

PlaySound( "C:\FILEHERE.WAV" )

LogMessage( "C:\FLAG.LOG", "File showed up" )

GoTo(":Start")

:NoFile

PlaySound( "C:\NOFILE.WAV" )

LogMessage( "C:\FLAG.LOG", "File isn't there" )

GoTo(":Start")

:Done

// more functions after this

...

You'll notice that the line GoTo(":Start") occurs three times. The :Start label acts as the top of the loop. The :FileHere and :NoFile labels mark the start of the block of functions to execute depending on which was chosen, and each returns to the top of the loop ( :Start ). Which block to jump to is decided by the second If statement. The first If statement is what decides when to quit the loop. You will want to avoid programming infinite loops that never exit! However, if you do, you won't be the first, and the next section explains some possible scenarios where you might accidentally write some, and what you should do if you deliberately want to write one.

  Infinite Looping


Infinite Looping

THE CONTENTS OF THIS SECTION HAVE BEEN CHANGED. GROUNDCONTROL SUPPORTS INFINITE LOOPS WITHOUT THE 5000 LOOP MAXIMUM AS DESCRIBED IN FORMER VERSIONS OF THE PRODUCT.

In this section, we point out some pitfalls of coding that you may encounter. What do you think the following examples do?

1. Simple loop:

:Start

// do stuff

GoTo(":Start")

2. Another simple loop:

:Start

// do stuff

Repeat( GoTo(":Start" ), 1 )

3. Two-point loop:

:PointA

// do stuff

GoTo( ":PointB")

:PointB

// do more stuff

GoTo( ":PointA")

These are common examples of infinite loops. They will execute over and over. Now, how about this one:

4.	In macro file "EXAMPLE.gc":

Beep()

RunMacro( "EXAMPLE.gc" )

By running our macro file over and over, we are bypassing the loop limit and have created a true infinite loop. The end result of this is a stack fault, because we have called our own macro without ever truly exiting it first. This kind of problem is called a re-entrancy error.  Make sure you don't call yourself! Here's another example using two macro files:

5. In macro file "EXAMPLE1.gc":

LogToFile("f:\gc\x.txt","hello from example1.gc")

RunMacro( "EXAMPLE2.gc" )

    but in macro file "EXAMPLE2.gc" the following exists:

LogToFile("f:\gc\x.txt","hello from example2.gc")

RunMacro( "EXAMPLE1.gc" )

This code generated a log file 50 pages long before it finally ran out of stack space! What's sad about this is that the code looks OK, and even runs for a while, but it will crash eventually. You should easily be able to imagine a scenario where you have accidentally written a loop consisting of three or four files, but none of the files looks wrong. Your best bet here is to print out all your macros, close the door, unplug the phone, and start following the GoTo and RunMacro statements. If you end up where you started, you have found an infinite loop!

As a last example, look at the following little clip. You might think that it looks OK, but there is a problem:

6.	In macro file main.gc:

While(FindWindow("main.gc - GrndCntl"),RunMacro("f:\gc\beep.gc"))

In macro file beep.gc

If( FileExist("Q:\FLAG.DAT"),Beep())

//Delay(1000)

This is just like the earlier example, except with the Delay statement commented out. Everything looks OK, we have a While loop that executes as long as GroundControl is running, and it avoids re-entrancy and stack faults by using a subroutine. The problem is that since there is no delay, the loop is tight, and there is no chance for anything else to happen. In computer jargon, the GroundControl thread or process never has a chance to respond to any other messages. You can make the delay as small as 1 ms if you want and the program will run. If you make it zero, or take the delay statement out, you will have to use the Task Manager to kill the process.

So to summarize, if you want an infinite loop, you should meet the following conditions:

1.	Use a While statement to look for the GroundControl window ( which will always be there )

2.	Call RunMacro to execute the body of the While loop.

3.	Add some small delay inside the loop to keep the thread from locking up.

Good luck!


Asking for it
Interactive Dialogs

What's more polite than a program that asks you nicely for stuff, and listens to what you said? OK, besides a  Knight of the Bath after a good dubbing? Nothing, right? Right. How do you write one of those?

The best way is to use the MessageBox,  MessageBoxOkCancel, and InputBox functions. The first simply throws up a box with your favorite message on it, like "File didn't exist. Try again!". The user hits OK and the macro continues. The second box shows a message the same way,  but will return which button the user pushed to clear it, like "File didn't exist, run program anyway?". You can use them together as shown below:

MessageBox( "Going to look for account file" )

If( FileExist( "ACCOUNT.TXT" ), GoTo( ":Found" ), )

If( MessageBox( "Couldn't find the account file. Give up?" ), GoTo(":OtherStuff") )

RunProgram( "NOTEPAD" )

GoTo( ":OtherStuff" )

:Found

RunProgram( "NOTEPAD ACCOUNT.TXT" )

:OtherStuff

// keep going

As a different example, lets ask the user for a file name, and open that in notepad. The comments explain what happens as we go:

InputBox( "Gimme the name of the account file" )

// At this point the name is stored in the internal buffer used by GroundControl.

// there is enough room in the buffer for one answer at a time. We start notepad:

RunProgram( "NOTEPAD" )

// then send it the ALT-F combination to manipulate the menus for File-Open.

SendKeys( "%F" )

SendKeys( "O" )

// we now have the File Open dialog up with focus in the file name box.

// this is where we send it the contents of the buffer

SendInput( )

SendKeys("^M")

// ^M is like hitting Enter, or OK on the dialog. We should now have the file open

The InputBox function asks for one piece of text, and saves it in the input buffer until you send it someplace via SendKeys. This is good spot to examine the next feature, the SendKeys function in a little more detail.

  SendKeys


Tip SendKeys
SendKeys

SendKeys allows you to control another program as though you were actually running it. In Windows technical terms, the information you send via the SendKeys functions is placed in the Keyboard Input Queue for that program one keystroke at a time. If you wanted to send an address, for example "101, Pine St." this would actually be broken down and sent as:

"1"

"0"

"1"

","	comma character

" "

"P"

"i"

"n"

"e"

" "	space character

"S"

"t"

"."	period character

The capital P and S are a combination of the Shift and p and s keys respectively and are combined inside Windows, but you don't have to worry about them. Any string you send is dis-assembled into individual keystrokes. What's cool is that you just type anything as normal into the string you want to send, including upper-lower case and punctuation ( "My @#!53$% computer!!!" ) and it will be sent.

This functionality is enhanced by being able to send special keys, like CTRL-M, ALT-T, and the function keys F1 - F12, and even some funky system keys ( Home, Num Lock ). Now, why do you want to send ALT-F anyway? The answer is that these let you blast your way through menus and dialog boxes like there's no tomorrow. For example, fire up NotePad, and do the following:

ALT-F	// activate file menu

N	// choose new

H	// letter H

e	// letter e

l	// letter l

l	// letter l

o	// letter o

!	// exclamation

ENTER	// new line

ALT-F	// activate file menu again

a	// letter a

.	// period

t	// letter t

x	// letter x

t	// letter t

ENTER	// hit OK button to save file

You have created a text file called "a.txt" with the contents "Hello!". You sent the ALT-F combination twice to access the File menu, and some of the other keystrokes went either to the notepad document itself or to an entry in the dialog box.

This should illustrate the point of "focus". Where the keystrokes go is a matter of which window is selected, then where in the window, which menu, which field in the dialog box, etc. If you send keys to the wrong control the results will be unpredictable. In most cases, the system will probably just beep at you in error, but you could do more serious damage if the circumstances were right.

GroundControl has a shortcut for the special keys like ALT- and CTRL-. ALT- is symbolized by a % and CTRL- by a caret (^), as in:

ALT-F	is %F

CTRL-M	is ^M and can be used for ENTER

To send "Hello" followed by ENTER, use:

SendKeys( "Hello")

SendKeys("^M" )

To send ALT-F followed by X for an Exit command, use:

SendKeys( "%F")

SendKeys("X" )

You could send all the keystrokes in sequence like:

SendKeys("Hello^M") and SendKeys("%FX").

The other SendKeys functions allow you to send other data. They just format it as text and break it down into keystrokes before it gets sent. Use SendEnvironment to send an environment variable. If you're not sure what an environment variable is, it's one of those things the network manager told you that you had to have "set properly" in the "config.sys" file for your computer to work. You can see all your environment variables by opening a Command Window and typing "SET":

SendEnvironment( "WINDOW" ) sends "C:\WINDOWS"

SendEnvironment( "TEMP" ) sends "C:\TEMP"

You can use SendNow to send the current time, or parts of it:

SendNow( "%c")

If you are running several windows at once, the following allow you to specify which window to send the keys or input buffer to:

SendKeysToWindow 	send a line of text to the specified window

SendInputToWindow 	send the input buffer to the specified window

The last SendKeys command is SendKeysFromFile , which lets you put all your keystrokes into a file, and send the file. It also allows you to change windows mid-stream, so not everything has to go to the same window.

If you want to see a more elaborate example of how you can use GroundControl to communicate with another program using SendKeys, follow on:

  Key Codes

  Advanced SendKeys


Start another program?

This is accomplished with the RunProgram function. Use CloseWindow or QuitProgram to end when you're done.

Example:

RunProgram( "Notepad.exe" )


Check for disk space and stuff like that?

You can use the IfMoreThan or IfLessThan functions to check any of GroundControl's predefined variables, and make a decision based on the TRUE or FALSE result. These variables are defined for different aspects of memory and disk space. For example, to see if your PC has at least 32MB of physical memory, do the following:

IfMoreThan( MEMORY_TOTALPHYSICAL, 32000000, MessageBox( "My PC rocks!" )

Windows usually creates a swapfile to make room in physical memory as needed. There are variables to check the swapfile:

IfLessThan( MEMORY_AVAILPAGEFILE, 5000000, MessageBox( "Less than 5 MB left in the swapfile!" )

The sum of physical memory and the swapfile is called virtual memory, and you can check that too:

IfLessThan( MEMORY_TOTALVIRTUAL, 8000000, MessageBox( "Better buy some chips!" )

IfMoreThan( MEMORY_PERCENTUSED, 90, LogError( "Almost no room for growth - close some apps!" )

You can check the size and space of any hard drive too:

IfMoreThan( DISK_Q_FREE, 10000000, LogError( "10MB of space on network disk Q:!" ) )

IfMoreThan( DISK_C_SIZE, 2000000000, LogError( "You've got a two gigabytes hard drive!" ) )

Finally, there are a few string constants, like your computer name, the user name, etc. These can't be used by IfMoreThan or IfLessThan, but you can log them to a file with LogSystem. LogSystem can log any of the disk or memory variables as well. See LogSystem and IfMoreThan, IfLessThan for details.


Move windows around?

You can minimize, maximize, restore, and close Windows using the simple commands below. As long as you know the exact title of the window, you can use these commands, plus a bunch of others:

MinimizeWindow ( "Calculator" )

MaximizeWindow ( "File Manager" )


Write stuff to a file?

You can use LogToFile , LogSystem , and LogError to create time-stamped system logs. These look like this:

01/24/97 19:50:20 User said no to my dialog box

01/24/97 19:50:25 The Calculator program wasn't running.

Alternately, you can use WriteToFile and WriteLineToFile to create non-timestamped text files with and without carriage returns appended for you automatically.


Interactively fill out a dialog box?

If you know the fields of the dialog box in advance, you can use the SendKeys functions to transmit keystrokes to the box controls. Generally, you will send ALT- combinations to set focus to a control, then send the keys you want to enter in. You can send date, time, and environment variables via different SendKeys functions, but the really cool function is by using the InputBox to ask for something from the user, and then send what they typed in using SendInput.

For more information, check out the tutorial on SendKeys.

See Also:

  SendKeys Function

  SendKeys Tutorial

  SendKeys Overview


Make a choice based on the result of a function?

The If statement lets you specify what to do if a function succeeds or fails. A very common example is to check for a file or program, and use GoTo to jump to a different part of the program:

If( FileExists("myfile.txt"), GoTo(":Yes"), GoTo(":No") )

You can check resources and branch using the IfMoreThan and IfLessThan functions. You don't necessarily have to branch someplace:

IfMoreThan( MEMORY_TOTALPHYSICAL, 64000000, MessageBox( "This PC has way more than enough memory!" ))

IfLessThan( DISK_C_FREE, 10000000, MessageBox( "This PC has less than than 10MB of disk space left!" ))


Ask the user for something, and make a decision on it?

You can use the If statement to check the results of OK/Cancel message boxes:

If( MessageBoxOkCancel( "Should we continue?" ), GoTo(":RunProg"), GoTo(":GiveUpGhost") )

You can use the ResponseOk or ResponseCancel functions too:

MessageBoxOkCancel( "Should we continue?" )

If( ResponseOk(), GoTo(":RunProg"), GoTo(":GiveUpGhost") )


Write a For-Next loop?

You can use a simple Repeat function to execute one statement a specified number of times:

// annoying noise

Repeat( Beep(), 50 )

If you want to repeat a group of statements, you are better off putting those statements in a separate file, and using the RunMacro with the repeat:

//for-next loop

Repeat( RunMacro("chores.gc"), 50 )

If you have a need for this, you should review the tutorial on loops and branches.

Also See:

  Loops and Branches


Write a Do-While loop?

GroundControl has a While statement that accepts a function to evaluate every pass, and a function to execute if true. If false, the loop exits:

// annoying noise

Repeat( Beep(), 50 )

If you want to repeat a group of statements, you are better off putting those statements in a separate file, and using the RunMacro with the repeat:

//do-while loop

While( FileExists("signal.txt"), RunMacro("chores.gc"), 50 )

If you have a need for this, you should review the tutorial on loops and branches.

Also See:

  Loops and Branches


IfMoreThan

IfMoreThan(<A>,<B>,< Action if A more than B >)

IfMoreThan compares A against B and performs the specified action if A is more than B.

Parameters:	A,B - Numbers or numerical constants

Action - The action if A is more than B

This function is useful for monitoring system resources like disk space, memory, etc. You will generally enter one of the numerical constants listed below for parameter A and a number for B. Constants exist for memory and disk space monitoring. The last two examples show how you can change the order of parameters and reverse the condition:

MEMORY_TOTALPHYSICAL	bytes of physical memory installed

MEMORY_AVAILPHYSICAL	bytes of physical memory available

MEMORY_TOTALPAGEFILE	bytes allocated for the pagefile

MEMORY_AVAILPAGEFILE	bytes left in the pagefile

MEMORY_TOTALVIRTUAL	bytes installed in physical memory  + allocated for pagefile

MEMORY_AVAILVIRTUAL	bytes left in physical + pagefile

MEMORY_PERCENTUSED	actual % ( 0-100 )

DISK_x_SIZE	total size of specified disk in bytes ( x can be A through Z )

DISK_x_FREE	actual bytes left on specified disk ( x can be A through Z )

Examples:

IfMoreThan(MEMORY_PERCENTUSED,50,GoTo(":LotsOfRoom"))

MessageBox("May run out of memory!")

GoTo(":Done")

:LotsOfRoom

MessageBox("Keep loading programs!")

:Done

You can put the constants in either parameter:

IfMoreThan(10000000,DISK_Q_FREE,MessageBox("AlmostOut"))

IfMoreThan(DISK_Q_FREE,10000000,MessageBox("PlentyOfSpace"))

See Also:

  IfLessThan

  IfEquals


IfLessThan

IfLessThan(<A>,<B>,<Action if A less than B>)

IfLessThan compares A against B and performs the specified action if A is less than B.

Parameters:	A,B - Numbers or numerical constants

Action - The action if A is less than B

This function is useful for monitoring system resources like disk space, memory, etc. You will generally enter one of the numerical constants listed below for parameter A and a number for B. Constants exist for memory and disk space monitoring ( See IfMoreThan for the full list ). The last two examples show how you can change the order of parameters and reverse the condition:

Examples:

IfLessThan(MEMORY_PERCENTUSED,50,GoTo(":RunningLow"))

MessageBox("Keep loading programs!")

GoTo(":Done")

:RunningLow

MessageBox("May run out of memory!")

:Done

You can put the constants in either parameter:

IfLessThan(10000000,DISK_Q_FREE,MessageBox("PlentyOfSpace"))

IfLessThan(DISK_Q_FREE,10000000,MessageBox("AlmostOut"))

Also See:

  IfMoreThan

  IfEquals


DdeCommand

DdeCommand(<application>, <topic>, <command>)

Parameters: 	application - DDE server application

topic - DDE server topic

command - A single DDE command

DdeCommand will send a single DDE command to the specified application and topic. The application must support DDE commands, and the command must be in the syntax supported by the server. This will vary from server to server.

GroundControl will open a conversation to the application and topic, send the command, and close the conversation. This tends to create overhead if you have a series of commands to send, so if you have two or more, you might consider using the DdeScript function instead.

Examples:

DdeCommand("launchpad","commands","FileClose()”)

DdeCommand("launchpad","commands","Exit()")

See Also:

  DdeScript

  DDE Overview


DdeScript

DdeScript(<application>, <topic>, <command script file>)

Parameters:	application - DDE server application

topic - DDE server topic

command - script file filename with DDE commands

This function allows you to open a single conversation, and send a large number of DDE execute commands before closing the link. The commands are stored in a single text file, and look exactly like the single commands in DdeCommand:

Example:

Suppose we have a hypothetical server and topic:

DdeScript( "launchpad", "commands", "longlist.txt" )

If longlist.txt has the following contents, the commands would be executed one after the other:

FileClose()

Exit()

Also See:

  DdeCommand

  DDE Overview


DDE Overview

Dynamic Data Exchange (DDE) is a protocol that permits two applications to communicate by exchanging data through a DDE "connection."  Through this connection you can send commands that open, close, and save files, etc. Applications that can receive DDE commands will often list the available DDE commands in the help file. Not all programs support DDE, however.

To establish a connection, you need a server application and a topic name. The server is usually the name of the program you are connecting to, but the topic is a little more specific. If you were connecting to a program that supplied times for different countries, the application might be “timeclock”, and the topics might be ”USA”, “Canada”, “Brazil”, “Vanuatu”, etc.

If the program is running on a different PC on a network , the sever name is prefixed with a \\NODENAME\ specifying the PC name. Thus, if there were two PCs running “timeclock”, each for a different hemisphere, you might use the following server and topics:

“\\NORTHERN\timeclock”, “USA”

“\\SOUTHERN\timeclock”, “Brazil”

Once a connection has been established, you typically make a request for or send an item of data, or send a command string for the server to execute. This is very specific to each application, and you must have the syntax for that application in order to establish a conversation with and/or make requests of it.

See Also:

  DDE Tutorial

  DdeCommand

  DdeScript


GoTo

GoTo(<label>)

GoTo jumps program execution to the label

Parameters:	label - Specifies the label to go to

Returns:	TRUE if successful; otherwise FALSE.

The function is used to move program execution to the line after the label. You would use this command as a way to branch execution to another part of your program.

Examples:

MessageBoxOkCancel("Do you want to continue?")

If(ResponseOk(),GoTo(":process"),ExitMacro())

:process

LogToFile("c:\test.log","Processing....")

Also See:

  Labels


Labels

Labels used to identify a location that is accessed using GoTo().

Labels are used to mark a location in a program. You can then route the execution of the program to the label using the GoTo() function. Label are defined as any text string beginning with a colon (":"). For example the following are all labels

:end

:process files

:error

Examples:

MessageBoxOkCancel("Do you want to continue?")

If(ResponseOk(),GoTo(":process"),ExitMacro())

:process

LogToFile("c:\test.log","Processing....")

Also See:

  GoTo


Repeat

Repeat(<command>, <number of times>)

Repeat executes a command a specified number of times

Parameters:	command - The command to execute

times - The number of times to repeat the command

The Repeat command is used to repeat a command a specified number of times. If you want to repeat more than one command, you need to use a Repeat( RunMacro(), x )  command where the commands you want to repeat are in a separate macro file. For more information in this, see the Tutorial on Loops and Branches.

Examples:

RunProgram("c:\winnt\notepad.exe")

Delay(2000)

Repeat("This is a test~",10)

Also See:

  While

  GoTo

  RunMacro


While

While(<condition>, <action>)

While accepts a condition function to evaluate every pass, and an action function to execute if true. If false, the loop exits:

Parameters: 	condition - function to evaluate

action - function to execute if the condition is found to be true

Examples:

// create an annoying noise

Repeat( Beep(), 50 )

If you want to repeat a group of statements, you are better off putting those statements in a separate file, and using the RunMacro with the repeat:

//do-while loop

While(FileExists("signal.txt"), RunMacro("chores.gc"))

See Also:

  Loops and Branches

  RunMacro


WaitForProgram

WaitForProgam(<milliseconds to wait>)

WaitForProgram halts program execution until the launched program completes execution and exists.

Parameters:	milliseconds to wait - determines how long the program will wait

WaitForProgram is only used with the RunProgram command to suspend macro execution until the launched program completes and exits. You pass in the number of milliseconds to wait or -1 to wait indefinitely.

This is different than the Delay function, which simply suspends the GroundControl thread for the desired time. WaitForProgram actually monitors the last process started with the RunProgram function, and suspends execution of the GroundControl thread until either the monitored process goes away or the timeout expires. In other words, don’t use WaitForProgram unless you just executed a RunProgram.

WaitForProgram only works on one program at once – the last program executed with RunProgram. That is why you don’t actually specify the program name in the WaitForProgram function.

Do not use WaitForProgram to wait for a program to BEGIN execution. You can only use it to detect when a program has ENDED execution.

Examples:

RunProgram("c:\winnt\notepad.exe")

WaitForProgram(-1)

Also See:

  RunProgram

  Delay


NormalizeWindow

NormalizeWindow()

NormalizeWindow restores the active window to its normal size

Parameters:	None.

Returns:	TRUE if successful; otherwise FALSE.

NormalizeWindow restores the currently active window to its original size. You can use this command to restore a window that has been minimized or maximized.

Examples:

NormalizeWindow()

Also See:

  MinimizeWindow

  MaximizeWindow


MinimizeWindow

MinimizeWindow()

MinimizeWindow minimizes the current active window

Parameters: 	None.

Returns:	TRUE if successful; otherwise FALSE.

MinimizeWindow minimizes the currently active window. You can use this command to restore the active window to its original size. You can make sure the window is active first by using ActivateWindow.

Examples:

ActivateWindow(“Untitled - Notepad”)

MinimizeWindow()

Also See:

  NormalizeWindow

  MaximizeWindow

  ActivateWindow


MaximizeWindow

MaximizeWindow()

MaximizeWindow maximizes the current active window

Parameters: 	None.

Returns:	TRUE if successful; otherwise FALSE.

MaximizeWindow maximizes the currently active window. You can use this command to restore the active window to its original size. You can make sure the window is active first by using ActivateWindow.

Examples:

ActivateWindow(“Untitled - Notepad”)

MaximizeWindow()

Also See:

  NormalizeWindow

  MinimizeWindow

  ActivateWindow


OnError

OnError(<label>)

OnError defines the label that will be called when an error occurs

Parameters: 	label - Where to jump to if an error occurs.

OnError defines a special label that program flow will go to whenever an error in the program occurs. You can use this to write your own error handling routine.

Examples:

OnError(":error")

// your macro commands

LogToFile("mylog.txt","Macro completed successfully")

ExitMacro

:error

LogError("Macro failed")

Also See:

  GoTo


SendNow

SendNow(<format string>)

SendNow sends the current date and time as keystrokes

Parameters:	format string - The string that defines the date time format

SendNow sends the current date and time as keystrokes to the current active window. The format of the string is defined by the format string parameter.

Date Formats for SendNow() command:

%a	Abbreviated weekday name  = Mon

%A	Full weekday name = Monday

%b   	Abbreviated month name = Feb

%B   	Full month name = February

%c   	Date and time representation appropriate for locale = 02/10/97 19:58:35

%d   	Day of month as decimal number (01 – 31) = 10

%H   	Hour in 24-hour format (00 – 23) = 19

%I   	Hour in 12-hour format (01 – 12) = 07

%j   	Day of year as decimal number (001 – 366) = 041

%m   	Month as decimal number (01 – 12) = 02

%M   	Minute as decimal number (00 – 59) = 58

%p   	Current locale’s A.M./P.M. indicator for 12-hour clock = PM

%S   	Second as decimal number (00 – 59) = 35

%U   	Week of year as decimal number,  with Sunday as first day of week (00 – 51) = 06

%w   	Weekday as decimal number (0 – 6; Sunday is 0) = 1

%W   	Week of year as decimal number, with Monday as first day of week (00 – 51) = 06

%x   	Date representation for current locale = 02/10/97

%X   	Time representation for current locale = 19:58:36

%y   	Year without century, as decimal number (00 – 99) = 97

%Y   	Year with century, as decimal number = 1997

%z, %Z	Time-zone name or abbreviation; no characters if time zone is unknown = Pacific

Also See:

  SendKeys

  SendKeysToWindow

  SendEnvironment


SendEnvironment

SendEnvironment(<message string>)

SendEnvironment sends an environment variable as text to the active window.

Parameters: 	message string - string to send, including environment variables.

SendEnvironment expands strings containing environment variables and sends them as keystrokes to the currently active window. You can see all the environment variables on your PC by opening a command window ( DOS Box ) and type "SET".

You can specify a delay between characters in the System Options dialog.

Examples:

SendEnvironment("The temp path is %TEMP%")

Also See:

  SendNow

  System Options


SendInput

SendInput()

Parameters: 	None.

SendInput is used to send the text that was input from the user in the InputBox command.  The text is sent as keystrokes to the active window.

You can specify a delay between characters in the System Options dialog.

Examples:

InputBox("Enter your name:")

ActivateWindow("Untitled - Notepad")

SendInput()

Also See:

  InputBox

  SendInputToWindow

  System Options


PowerOff

PowerOff()

PowerOff is used to power down computers equipped with ability to turn off power automatically, like notebooks.

Parameters: 	None.

Example:

PowerOff()


LogSystem

LogSystem(<File Name>,<Resource>)

LogSystem Log system information to a specified file.

Parameters: 	File Name - Specifies the name of the file to write system information to.

Resource - Specifies the type of resource information.

You can use LogSystem to track information such as free disk space and memory usage.

Available resource information includes:

Disk Information:	DISK_C_FREE

DISK_C_SIZE

DISK_X_FREE

DISK_X_SIZE

You will need to replace the ‘X’  in the above commands with a drive letter i.e. DISK_D_FREE

Memory Information:	MEMORY_AVAILPAGEFILE

MEMORY_AVAILPHYSICAL

MEMORY_AVAILVIRTUAL

MEMORY_PERCENTUSED

MEMORY_TOTALPAGEFILE

MEMORY_TOTALPHYSICAL

MEMORY_TOTALVIRTUAL

Environment Information:	SYSTEM_DIR

WINDOWS_DIR

USER_NAME

Examples:

LogSystem("C:\Test.log",DISK_C_FREE)

Also See:

  LogToFile

  LogError

  WriteLineToFile

  WriteLineToFile


How Do I Use DDE Effectively?

DDE is a powerful tool if used correctly. It stands for Dynamic Data Exchange and it allows two or more Windows programs to make requests of each other via a well-structured syntax. Typically, it is used to request or send items of data, but it also allows for the transmission of commands to another program. DDE can be configured to work between computers on a network, so you can actually control programs on other PCs.

You can use DDE through GroundControl to send DDE commands to a server application if that server supports DDE commands. If it does, you will need to know the syntax it supports, and any peculiarities in the command language that may exist. A well-written DDE server will have a well-documented set of commands, representing at least most of the commands you would need to use.

To send a DDE Command, you need to establish a conversation with a server and topic. You then send the command as a carefully formatted string, and close the conversation. GroundControl does all of these for you with a simple function:

DDECommand( "servername", "topicname", "carefully_formatted_command_string" )

The server and topic for an imaginary editor might be "slicktyper" and "commands". The command string depends on what you want to do, but it must be supported by the server. To tell the slicktyper server to quit might require an "[Exit()]" command. To tell it to open a file might need a "[FileOpen('C:\myfile.txt)']".

If you are following closely, you might be thinking it is inefficient for GroundControl to open and close a conversation for every command, and you would be correct! If you have a long sequence of commands to send, then it is much better for you to put them into a file, and run DDEScript instead. This command opens the conversation once, then executes all the commands in the file before closing the link. It is better to use DDEScript if you have more than three or four commands to send.

Beware: some servers support more than one topic, and not all commands may go to the same topic. If you are using DDEScript, all commands go to the same topic, and you will have to separate them out.

  DDE vs SendKeys

  DDE Overview

  DdeCommand

  DdeScript


What's the advantage of DDE over SendKeys?

You might think SendKeys is easier than DDE, and you would be right. SendKeys is does not require a conversation link, where DDE does. However, SendKeys can be confusing because you have to keep very close track of where your keys are going, which can get tricky if your windows lose focus or get hidden. DDE on the other hand, is like a solid pipe through which your commands can flow, and you don't have to worry about where it goes once you send it. The server does that work for you.

DDE has one other advantage. If your PC is part of a network, and NetDDE has been configured on another PC, you can send commands to a program on that PC! The network is invisible, and as long as you know the name of the machine, only the server name has to be modified. The example command above to open a slicktyper file on your machine becomes the following if you want to tell slicktyper on another machine to open a file:

DDECommand("\\remotepc\slicktyper", "commands", "[FileOpen('c:\myfile.txt')]" )

In this example, the remote PC would open a file called myfile.txt on its C drive, not yours. The topic and command are exactly the same, but the server name has been prefixed with "\\nodename\". SendKeys does not work across different PCs.

The only thing holding you back from sending DDE commands all over the network is any security the manager may have implemented using DDE Shares. These can be tricky to set up, and if you cannot get DDE commands working over the network, you may need to see your LAN manager and have them check that NetDDE is running on both PCs, and that the remote PC has a DDE Share for you.


GroundControl does math too?

Here's an example where GroundControl is an interactive front end for another program. Suppose we want to turn the Microsoft Calculator program into an interactive, MessageBox application. We will use GroundControl to ask for two number to multiply together, and write the answer to a file called answer.txt.

RunProgram("notepad")

RunProgram("calc")

Delay(1000)

InputBox( "Please enter the first number" )

SendInputToWindow("Calculator")

SendKeysToWindow("Calculator", "*" )

InputBox( "Please enter the second number" )

SendInputToWindow("Calculator")

SendKeysToWindow("Calculator","=")

// now get the number back, hmmmm...

SendKeysToWindow("Calculator","^C")

SendKeysToWindow("Untitled - Notepad","answer: ")

SendKeysToWindow("Untitled - Notepad","^V, and don't forget to check it.")

MessageBox("Done!")

This will send the two numbers to multiply to the Calculator, and uses the clipboard to get the answer back. GroundControl opens notepad, and types the answer into it. Easy, eh?

If you think about it, by using the clipboard, you have access to numbers from almost any application. Although clipboard doesn't work over a network, you could easily paste answers into a notepad text file, and save that on the network. Then use DDE or some file trigger on the remote PC to open that file. You can get complicated, but the opportunity is there.


Getting Started

Cool! You've just opened up a very powerful little program. You should probably take a look around some of the help topics listed below, and familiarize yourself with what's available. You'll probably realize that most of the commands are things you do every day without thinking about it, especially the basic windows commands, and these shouldn't present any problem. If you just can't wait to get started, select Tease Me! below.

  Tease Me!

If you're still here, good. If you are a novice programmer, don't worry, you're in good hands. There is a ton of help to assist you as you build programs, and not just the technical reference-type stuff either. (Check out the tutorial on Loops and Branches!). If you have had lots of programming experience, you'll find the If, For, Repeat, GoTo functions a cake-walk. You'll be more interested in the interactive dialogs, the SendKeys and DDE features. Some of these commands take a little more time to learn how to use properly, but they really let you to stretch out your control ability.

  Official High-Brow Program Overview

  Overview of Commands by Category

  Loops and Branches Tutorial

  DDE Tutorial

  SendKeys Tutorial

  How Do I ...

If you made it past all these, there's just a few more words to say. If this is all new, don't worry, you'll be turning out DDE subroutines in no time. Learn how to use the toolbars - you may not need all of them but you'll wonder how you did without them. Read the help files whenever you have problems, and enjoy the product!


MessageBox

MessageBox(<message>)

MessageBox creates a simple message box with text you specify, plus an OK button.

Parameters:	message - Specifies the text that will be displayed in the message box prompt.

MessageBox enables you to display a message to the screen. The execution of the macro stops until the OK button is clicked.

Examples:

MessageBox("File not found. Press OK to continue.")

Also See:

  ResponseOk

  ResponseCancel

  MessageBoxOkCancel

  InputBox


RunDOSCommand

RunDOSCommand(<DOS Command>)

RunDOSCommand will execute the specified DOS command from a command prompt.

Parameters:	DOS Command - Specifies the name of the DOS command to execute.

You can use RunDOSCommand to execute any command you can run from a command prompt (Copy, Del, Dir, etc.).

Examples:

RunDOSCommand("Copy C:\*.bat C:\Temp\*.*")

Also See:

  RunProgram


How Do I
How Do I …

Here’s some tips to help you get started:

Start another program

Check for disk space and stuff like that

Move windows around

Write stuff to a file

Interactively fill out a dialog box

Make a choice based on the result of a function

Ask the user for something, and make a decision on it

Write a Do-While Loop

How do I use DDE effectively

Run my new macro


Using GroundControl with LaunchPad

GroundControl and LaunchPad are very complementary programs when used together. Since GroundControl lets you build your own Windows batch files, and LaunchPad lets you schedule unattended tasks, using them together really extends your power.

To run GroundControl macros from LaunchPad, follow these simple steps:

1.	Create a macro using GroundControl and save it.

2.	Run LaunchPad.

3.	Click on the Clock icon to add an event.

4.	Type in a description for your event ("Launch My Macro"), and then use the Open Folder icon at the end of the Command Line to browse through your directories until you find the Ground Control exe file (GC.EXE). In the ‘Command Line’ box  after the exe type a space then “/r” followed by the path to the GroundControl macro file you want.  Your command line might look something like this ‘gc.exe /r myfile.gc’

5.	Press "Next" to select the "Schedule" tab sheet, and set the date and time you want to run the program.

6.	Press the Checked Clock icon to enable this event, and the Frequency description should change from "Never" to "One Time".


Key Codes

Key	Code

Shift	+

Control	^

Alt	%

BackSpace	{BKSP}

Break	{BREAK}

Caps Lock	{CAPSLOCK}

Clear	{CLEAR}

Del	{DELETE}

Down Arrow	{DOWN}

End	{END}

Enter	{ENTER} or ~

Esc	{ESC}

Help	{HELP}

Home	{HOME}

Ins	{INSERT}

Left Arrow	{LEFT}

Num Lock	{NUMLOCK}

Page Down	{PGDN}

Page Up	{PGUP}

Print Screen	{PRTSC}

Right Arrow	{RIGHT}

Scroll Lock	{SCROLLLOCK}

Tab	{TAB}

Up Arrow	{UP}

F1	{F1}	F2	{F2}

F3	{F3}	F4	{F4}

F5	{F5}	F6	{F6}

F7	{F7}	F8	{F8}

F9	{F9}	F10	{F10}

F11	{F11}	F12	{F12}

F13	{F13}	F14	{F14}

F15	{F15}	F16	{F16}

{Activate}	{Delay}	{Date}	{Time}

{Day}	{Month}	{Year}	{Hour}

{Minute}	{Second}


SendKeys Overview

You can define a series of keystrokes to automatically send as part of the macro using the SendKeys and SendKeysToWindow functions.

Each key is represented by one or more characters.  To specify a single keyboard character, use the character itself.  For example, to represent the letter A, use A for key text.  If you want to represent more than one character, append each additional character to the one preceding it.  To represent the letters A, B, and C, use ABC for key text.

The plus sign (+), caret (^), percent sign (%), tilde (~), and parentheses ( ) have special meanings to SendKeys.  To specify one of these characters, enclose it inside braces.  For example, to specify the plus sign, use {+}.  Brackets ([ ]) have no special meaning to SendKeys, but you must enclose them in braces as well, because in other applications for Microsoft Windows, brackets do have special meaning that may be significant when dynamic data exchange (DDE) occurs.  To send brace characters, use {{} and {}}. To specify characters that aren't displayed when you press a key (such as Enter or Tab) and keys that represent actions rather than characters, use the key codes defined in the SendKeys Codes.

Key Codes

To specify keys combined with any combination of Shift, Ctrl, and Alt keys, precede the regular key code with one or more of the following codes:

Key	Code

Shift	+

Control	^

Alt	%

NOTE:  The percent sign “%” character is the character for sending the ALT key.  The percent sign is also the character that GroundControl uses to identify variables.  This means that to send an ALT-F you will need to enclose the “%F” in parentheses < SendKeys(“(%f)”) >.  If the parentheses are omitted GroundControl will remove the quotes and send the characters in the %F variable.  If more than the two characters are in the “Keystrokes to send” parameter the parentheses can be omitted.

Example:

PutVar(%f,”Hello World”)

SendKeys(%f)           = Hello World

SendKeys(“(%f)”)      = ALT-F

SendKeys(“{%}F”)     = %F

SendKeys(“%F %D”) = ALT-F ALTD

To specify that Shift, Ctrl, and/or Alt should be held down while several other keys are pressed, enclose the keys' code in parentheses.  For example, to have the Shift key held down while E and C are pressed, use "+(EC)".  To have Shift held down while E is pressed, followed by C being pressed without Shift, use "+EC".

To specify repeating keys, use the form {key number}. You must put a space between key and number.  For example, {LEFT 42} means press the Left Arrow key 42 times; {h 10} means press h 10 times.

Now, SendKeys will also recognize some special “sub-commands”. These are special instructions to implement delays, window commands, etc. They do the same thing as some of the other GroundControl macros, but they allow you to do it from within the SendKeys commands. This is very powerful if all your SendKeys commands are in a separate file, and you are executing the file with a single SendKeysFromFile command.

{Activate “<window title>”}

This sub-command will select the window named to be the active and top most window. The command is not case sensitive but the name must match the window exactly. For example, the following will bring notepad to the top-most window and all additional keys would be sent to this application:

{Activate "Untitled - Notepad"}

This has the same effect as the GroundControl command ActivateWindow( “Untitled - Notepad” ).

{Delay <timeout>}

This sub-command will wait a determine time before sending the next key to the event. You specify the time in milliseconds following the command. For example, this will wait 1 second before execution of the next key:

{Delay 1000}

This has the same effect as the GroundControl command Delay( 1000 ).

{Date [<offset>]}

This sub-command will send the current date as text. You can also define date math following the command. For example:

{Date 1}	will send  tomorrow's date

{Date -1}	will send yesterday's date. You must leave a space between the command and the number.

{Time [<offset>]}

The Time sub-command sends the current time as text. You can also do math on this function by defining the amount of seconds after the time command. For example:

{Time 60}	would send the current time + one minute.

{Time -60}	would send the current time minus one minute.

{Day [<offset>]}

The Day sub-command will send the numeric value for the day of the current date. You can also do math on this function by defining the amount of days after the command. For example:

{Day 1}	would add one to the current day.

{Day -1}	would subtract 1 day.

{Month [<offset>]}

The Month sub-command will send the numeric value for the month of the current date. You can also do math on this function by defining the amount of months after the command. For example:

{Month 1}	would add one to the current month.

{Month -1}	would subtract one from the current month.

{Year [<offset>]}

The Year sub-command will send the numeric value for the Year of the current date. You can also do math on this function by defining the amount of Years after the command. For example:

{Year 1}	would add one to the current year.

{Year -1}	would subtract a year.

{Hour [<offset>]}

The Hour sub-command will send the numeric value for the current hour. You can also do math on this function by defining the amount of hours after the command. For example:

{Hour 1}	would add one hour.

{Hour -1}	would subtract a hour.

{Minute [<offset>]}

The Minute sub-command will send the numeric value for the current minutes. You can also do math on this function by defining the amount of minutes after the command. For example:

{Minute 1}	would add one minute.

{Minute -1}	would subtract a minutes.

{Second [<offset>]}

The Second sub-command will send the numeric value for the current second. You can also do math on this function by defining the amount of seconds after the command. For example:

{Second 1}	would add one second.

{Second -1}	would subtract a second.

You can also specify a delay between each character in the system Options dialog.

Also See:

  SendKeys Tutorial

  System Options


SendKeysFromFile

SendKeysFromFile(<filename>)

SendKeysFromFile reads the specified file and sends the contents one character at a time to the active window.

Parameters:	filename - Specifies the file containing the text to send.

The advantage of this command over the SendKeys command is that you can put everything you want to send in one file, and execute the entire file with one statement. You can change which keys go to which window within the file, so you don’t have to have a file for each program.

Examples:

SendKeysFromFile(“commands,txt")

Also See:

  Key Codes

  Using SendKeys

  System Options


FileOlderThan

FileOlderThan(<filename>, <age>)

FileOlderThan returns TRUE if the file is older than the allowed age.

Parameters:	filename - name of the file to examine

age - maximum allowed age in seconds

Returns:	TRUE if the file is older than the specified age in seconds.

FALSE if the file cannot be found or it is younger than the specified age.

Examples:

FileOlderThan("a.txt",86400)


Order Information

Thank you for trying GroundControl! During the 30-day evaluation period you will have access to all of GroundControl's features, giving you a chance to experience the product without any restrictions. (Except that registration reminder screen on startup.)

When you purchase a licensed copy of GroundControl you will receive a registration number, that when installed, will remove the shareware reminder screens from the application startup.  All orders for GroundControl are subject to the GroundControl licensing agreement . You can also order a diskette copy of the application for additional cost.

There are several ways to order GroundControl:

  Pricing

  Order Form

  Ordering by Check or Money Order

  Ordering by Purchase Order

  Ordering by Credit Card


Comment

A Comment is not a command, but a macro line that will not be executed.

Comment places two forward slashes at the front of the macro line, and these line are not executed.  Comments can be used in two different ways.  One use for comments is to make notes in your macros to document what the macro is doing at that point in its execution. Another is to disable lines for testing or debugging.

Examples:

//My Backup Macro

//Now check to see if the file was created and run the delete temps macro

If(FileExist("c:\temp\backups.log","RunMacro("DelTemps.grn")","ExitMacro()")

//Now Shutdown  un-comment the next line after testing

//ShutdownSystem()

//if testing just exit macro

ExitMacro()


System Options

The System Options allow you a little extra flexibility in tuning GroundControl.

Send Keys Delay

This allows you to specify the millisecond spacing between each character as it is transmitted.  This option is the first place to look when you are having dificulties with SendKeys.  Ninety percent of SendKeys problems stem from timing (sending keys too fast) or misdirection (sending keys to the wrong window).

Macro Editor

This option allows you to specify an external editor to use to edit the macro. If you would rather use your favorite editor to build your macro instead of GroundControl, simply choose Edit\External Editor, and GroundControl will launch your editor and load your macro into it. When you exit your editor, make sure you save your macro, and GroundControl will load it back in, if you choose to do so.

Print Line Numbers

This is used when you are printing out your macro. If checked, it simply puts the line number in front of the macro text.


PutVar

PutVar(<target variable name><source value>)

PutVar places a source value into the specified target variable.

Parameters: 	target variable name - Specifies the name of the variable to store the data in.

source value – specifies the data to place in the variable

Returns:	TRUE if successful; otherwise FALSE.

This function simply loads a number or string into a variable. We recommend you use quotes around text strings to make it obvious where the string begins and ends.

You can use a different variable for the source value to copy values from source to target. For example:

PutVar(%A,6)

PutVar(%B,%A)

// now %B equals 6 too

There is no corresponding GetVar command. To use the contents of the variable, simply use it it a command.

Examples:

PutVar(%A,23)

PutVar(%B,”Hello”)

PutVar(%C,”Hello there!”)

MessageBox(%C)

Also See:

  Using Variables

  Using Variables in Functions

  Dump


MoveFile

MoveFile(<from pathname><to pathname>)

MoveFile moves the specified file from one name or place to another.

Parameters: 	from pathname – specifies the original file

to pathname – specifies the destination path and file

Returns:	TRUE if successful; otherwise FALSE.

This function moves a file to a new location or name. You can use this to backup files to different locations. Existing files will not be overwritten. MoveFile works just like CopyFile except the original file is destroyed. If you use MoveFile in the same directory, the effect is the same as renaming it. You can specify a different name in the destination if you wish, but you must specify a file name.

Examples:

// different drive\directory\filename

MoveFile("C:\autoexec.bat","D:\autoexec.bak")

// same directory – rename the file in the current working directory

MoveFile("autoexec.bat","autoexec.bak")

Also See:

  CopyFile

  DeleteFile

  FindFile


CopyFile

CopyFile(<from pathname><to pathname>)

CopyFile copies the specified file from one name or place to another.

Parameters: 	from pathname – specifies the original file

to pathname – specifies the destination path and file

Returns:	TRUE if successful; otherwise FALSE.

This function copies a file to a new location or name. You can use this to backup files to different locations. Existing files will not be overwritten.

Examples:

// same directory, different name

CopyFile("C:\autoexec.bat","C:\autoexec.bak")

// same name, different directory

CopyFile("C:\autoexec.bat","D:\gc\autoexec.bat")

// different name and directory

CopyFile("C:\autoexec.bat","D:\gc\autoexec.bak")

Also See:

  MoveFile

  DeleteFile

  FindFile


CreateDirectory

CreateDirectory(<pathname>)

CreateDirectory creates a directory as specified in the pathname

Parameters: 	pathname – specifies the [optional] path and directory name

Returns:	TRUE if successful; otherwise FALSE.

This function creates a directory wherever you specify. You can include a full drive/path, or you can leave the path off and GroundControl will use the current working directory as a starting point. This is handy for creating your own temporary directories.

Examples:

// this puts a new directory under the working directory

CreateDirectory(“NEWDIR”)

// this puts a new directory on the drive indicated

CreateDirectory(“D:\MYSTUFF\NEWDIR”)

Also See:

  RemoveDirectory


RemoveDirectory

RemoveDirectory(<pathname>)

RemoveDirectory deletes the specified directory

Parameters: 	pathname – specifies the [optional] path and directory name

Returns:	TRUE if successful; otherwise FALSE.

This function deletes the specified directory. You can include a full drive/path, or you can leave the path off and GroundControl will use the current working directory as a starting point. The directory must be empty.

Examples:

DeleteDirectory(“OLDDIR”)

DeleteDirectory(“D:\MYSTUFF\OLDDIR”)

Also See:

  CreateDirectory


FindFile

FindFile(<filename><searchpath>[<variable name>])

FindFile looks in the specified path for the given file.

Parameters: 	file – specifies the file to look for

path – specifies the search path

variable name – where to return the full path (optional)

Returns:	TRUE if found; otherwise FALSE.

This function looks in the specified path for the requested file. If found, it returns TRUE, if not, FALSE. The file is simply a file name without a path, eg. “findme.txt”.

If you want to specify a directory, GroundControl will check there, but it will not recursively walk the tree below it. If you want a more expansive search, you can specify the word “PATH” for the search path, and GroundControl will examine every directory in the PATH environment variable, but not the directories below them.

Optionally, GroundControl will return the full system path and filename in a variable. The variable can be %A through %Z. This is handy if you want to search several directories, and want to know which one the file was found in.

Examples:

// this locates paintbrush using the system path and should return TRUE

If(FindFile(pbrush.exe,PATH),MessageBox("Found"))

// this locates a file using the system path and should return TRUE.

// it also should return “C:\WINNT\SYSTEM32\PBRUSH.EXE“ in %C

If(FindFile(pbrush.exe,PATH,%C),MessageBox("Found"),%C)

// this locates a file using a user specified path

If(FindFile(“readings.dat”,”C:\data”,%P),RunMacro(“import.mac”))

Also See:

  DeleteFile

  CopyFile

  MoveFile


Dump

Dump()

Dump() displays the Contents of Variables dialog box.

Parameters: 	None

Returns:	None

This function simply shows the Contents of Variables dialog box to the user during macro execution. This is vary handy when you want to check the values of variables between statements. Simply put “Dump()” anywhere you want to see what’s happening.

Examples:

// %A should have 23

PutVar(%A,23)

Dump()

// show what the user typed

InputBox("What is your favourite color?",%C)

Dump()

Also See:

  PutVar


GetSystem

GetSystem(<constant><variable name>)

GetSystem retrieves the one of the system constants as defined in the LogSystem function, and stores it in the specified variable.

Parameters: 	variable name - Specifies the name of the variable to store the data in.

Returns:	TRUE if successful; otherwise FALSE.

Use this function when you want to read disk space or size, memory values, user name or system name into a variable for further use in your macro.

Examples:

// this will create of time stamped log of the hard drive space

GetSystem(%T,DISK_C_FREE)

LogEvent(%T)

Also See:

  LogSystem

  LogEvent


GetClipBoard

GetClipBoard(<variable name>)

GetClipBoard retrieves the contents of the clipboard and stores them in the specified variable.

Parameters: 	variable name - Specifies the name of the variable to store the data in.

Returns:	TRUE if successful; otherwise FALSE.

Use this function when you want to get the contents of the Windows clipboard into your macro.

Examples:

GetClipBoard(%C)

WriteToFile(“myfile.txt”,%C)

Also See:

  PutVar


GetFileSize

GetFileSize(<file name>,<variable name>)

GetFileSize retrieves the size of the specified file in bytes, and stores the value in the variable.

Parameters: 	file name - specifies the name of the file to check.

variable name - specifies the name of the variable to store the data in.

Returns:	TRUE if successful; otherwise FALSE.

You can retrieve the size of a file in bytes via the GetFileSize function. The first parameter is the name of a file, the second is the variable in which to store the result.

Examples:

GetFileSize( “c:\autoexec.bat”,%B)

WriteLineToFile(“mylog.txt”,”The file size is: “)

WriteLineToFile(“mylog.txt”,%B)

This created file will look like this:

The file size is:	1196

Also See:

  PutVar


GetFromRegistry

GetFromRegistry(<hive\path><item><variable name>)

GetFromRegistry reads the specified entry from the hive and path and returns it in the specified variable.

Parameters: 	hive\path – specifies both the registry hive and path

item – specifies the actual item to read

variable name – specifies where to put the answer

Returns:	TRUE if successful; otherwise FALSE.

Please use extreme caution when doing any work with the registry. The registry is the most sensitive part of your operating system, and unless you know exactly what keys and items you are looking for, you should not be here! Consult any NT/95 operating system book for information on how to use and scan the registry.

This function reads the specified hive and key in the registry for the specified item, and puts the answer in the variable you choose. You can use any registry key you choose, so it is possible to create your own registry keys for the express purpose of storing values you want.

The hive must be one of the four recognized system hives: HKEY_CURRENT_USER, HKEY_USER, HKEY_CLASSES_ROOT, and HKEY_LOCAL_MACHINE. The hive is followed by the path to the desired item.

The variable can be %A through %Z, and you can use the same variable for multiple reads, provided you use the value retrieved before the next read. It doesn’t matter whether you read strings or numbers.

GetFromRegistry is related to WriteToRegistry. In Windows NT and Windows 95, the registry is the main storage location for everything from hardware device settings to user screen colors. If your intent is to use the registry to store data values or GroundControl strings, consider using ini files instead. Ini files are great for reading and writing variable values to persistent storage.

Hint: If you have multiple items to retrieve from the same key, store the key in a variable, say %K, and use the variable in the GetFromRegistry call. Your code will be much easier to read if you remember %K is just the key where your data is.

Examples:

// you can retrieve data from any key

GetFromRegistry(“HKEY_LOCAL_MACHINE\hardware\description\system”,”systembiosversion”,”%A”)

// multiple reads should use a variable to store the key

PutVar(%K,“HKEY_LOCAL_MACHINE\hardware\description\system”,”systembiosversion”)

GetFromRegistry(%K,”systembiosversion”,%A)

GetFromRegistry(%K,”identifier”,%B)

GetFromRegistry(%K,”systembiosdate”,%C)

// you can also use a variable for the item

PutVar(%K,“HKEY_LOCAL_MACHINE\hardware\description\system”)

InputBox(“Which item should we get?”,%I)

GetFromRegistry(%K,%I,%B)

Also See:

  PutVar

  WriteToRegistry


GetFromIniFile

GetFromIniFile(<filename><[section]item><variable name>)

GetFromIniFile reads the specified entry from the ini file and returns it in the specified variable.

Parameters: 	filename – specifies the ini file

[section]item – specifies both the section and item name

variable name – specifies where to put the answer

Returns:	TRUE if successful; otherwise FALSE.

This function reads any ini file for the specified [section] and item, and puts the answer in the variable you choose. You can use any ini file you choose, so it is possible to create your own ini files for the express purpose of storing values you want.

The [section] must be enclosed in square brackets as indicated, and immediately followed by the desired item. Normally, related items are grouped into sections, and again, you are at total liberty to define your own sections in any ini file you wish.

The variable can be %A through %Z, and you can use the same variable for multiple reads, provided you use the value retrieved before the next read. It doesn’t matter whether you read strings or numbers.

GetFromIniFile is related to WriteToIniFile. In Windows NT and Windows 95, ini files have been largely replaced by the registry, but they are still supported for compatibility with older applications that still use them. However, they are great for reading and writing variable values to persistent storage.

Examples:

// you can store legitimate program ini information

GetFromIniFile(“c:\gc\myapp.ini”,”[serial ports]port”,”%A”)

GetFromIniFile(“c:\gc\myapp.ini”,”[serial ports]baudrate”,”%B”)

// or you can create custom data storage files

GetFromIniFile(“c:\gc\weather.ini”,”[Tuesday]temperature”,%T)

IfMoreThan(%T,100,MessageBox(“Tuesday was hot!”))

GetFromIniFile(“c:\gc\weather.ini”,”[Wednesday]temperature”,%T)

IfMoreThan(%T,100,MessageBox(“Wednesday was hot!”))

Also See:

  PutVar

  WriteToIniFile


WriteToRegistry

WriteToRegistry(<hive\path ><item><variable name>)

WriteToRegistry writes the specified value into the hive and path indicated.

Parameters: 	hive\path – specifies both the registry hive and path

item – specifies the actual item to write to

variable name – specifies the value to write

Returns:	TRUE if successful; otherwise FALSE.

Please use extreme caution when doing any work with the registry. The registry is the most sensitive part of your operating system, and unless you know exactly what keys and items you are looking for, you should not be here! Consult any NT/95 operating system book for information on how to use and scan the registry.

This function finds the specified hive and key in the registry, and adds or updates the specified item with the new value. You can use any registry key you choose, so it is possible to create your own registry keys for the express purpose of storing values you want.

The hive must be one of the four recognized system hives: HKEY_CURRENT_USER, HKEY_USER, HKEY_CLASSES_ROOT, and HKEY_LOCAL_MACHINE. The hive is followed by the path to the desired item.

You can use a variable instead of specifying the value directly. The variable can be %A through %Z, and you can use the same variable for multiple. It doesn’t matter whether you write strings or numbers. GroundControl stores values as strings anyway.

WriteToRegistry  is related to GetFromRegistry. In Windows NT and Windows 95, the registry is the main storage location for everything from hardware device settings to user screen colors. If your intent is to use the registry to store data values or GroundControl strings, consider using ini files instead. Ini files are great for reading and writing variable values to persistent storage.

Hint: If you have multiple items to write to the same key, store the key in a variable, say %K, and use the variable in the WriteToRegistry call. Your code will be much easier to read if you remember %K is just the key where your data is.

Examples:

// you can write data to any key

WriteToRegistry(“HKEY_LOCAL_MACHINE\software\mycompany\groundcontrol”,”installedby”,”petersmith”)

// multiple writes should use a variable to store the key

PutVar(%K,“HKEY_LOCAL_MACHINE\\software\mycompany\groundcontrol”)

WriteToRegistry(%K,”mondayscript”,”normal.mac”)

WriteToRegistry(%K,”tuesdayscript”,”normal.mac”)

WriteToRegistry(%K,”wednesdayscript”,”archive.mac”)

// you can also use a variable for the item. This example saves the last user’s name

PutVar(%K,“HKEY_LOCAL_MACHINE\software\mycompany\groundcontrol”)

PutVar(%I,”LastLoggedInUser”)

GetSystem(%U,"USER_NAME")

WriteToRegistry(%K,%I,%U)

Also See:

  PutVar

  GetFromRegistry


WriteToIniFile

WriteToIniFile(<filename><[section]item><value>)

WriteToIniFile writes the specified value into the ini file at the specified section and item.

Parameters: 	filename – specifies the ini file

[section]item – specifies both the section and item name

value – specifies the value to write

Returns:	TRUE if successful; otherwise FALSE.

This function updates the specified [section] and item in any ini file with the specified value. You can use any ini file you choose, so it is possible to create your own ini files for the express purpose of storing values you want.

The [section] must be enclosed in square brackets as indicated, and immediately followed by the desired item. Normally, related items are grouped into sections, and again, you are at total liberty to define your own sections in any ini file you wish.

The value can be any string, number, or vairiable. If a variable, it can be %A through %Z, and you can use the same variable for multiple writes. It doesn’t matter whether you write strings or numbers.

WriteToIniFile is related to GetFromIniFile. In Windows NT and Windows 95, ini files have been largely replaced by the registry, but they are still supported for compatibility with older applications that still use them. However, they are great for reading and writing variable values to persistent storage.

Examples:

// you can store legitimate program ini information

WriteToIniFile(“c:\gc\myapp.ini”,”[serial ports]port”,”COM1”)

WriteToIniFile(“c:\gc\myapp.ini”,”[serial ports]baudrate”,9600)

InputBox(“Enter login name for next session”,%L)

WriteToIniFile(“c:\gc\myapp.ini”,”[serial ports]loginid”,%L)

// or you can create custom data storage files

WriteToIniFile(“c:\gc\weather.ini”,”[Tuesday]temperature”,67)

WriteToIniFile(“c:\gc\weather.ini”,”[Wednesday]temperature”,%T)

Also See:

  PutVar

  GetFromIniFile


Print

Print(<filename><optional execution mode>)

Print prints the specified document to the default Windows printer.

Parameters: 	file name - Specifies the name of the file to print

optional execution mod – specified how to run the program that prints the file

Returns:	TRUE if successful; otherwise FALSE.

This function prints the specified file to the default Windows printer. The command is executed by the Windows shell process, which launches the program associated with the file type, and sends it the “Print” command. All you have to do is make sure your file is a recognized type, and the application that created it will most likely do this for you anyway.

When the shell launches the application, it can launch it in one of four ways specified by the second parameter. These are the same parameters as used in the RunProgram command. If you do not specify a mode, GroundControl will assume “Normal”. These modes can be used to minimize the effect on the screen while you are working. You may not want your database application to suddenly interfere with your text editor while GroundControl prints a file in the background. Using “Hidden” mode will accomplish this.

The four modes are the same as for RunProgram:

Normal - program comes up as though launched from the Start menu while file is printing

Maximized - program comes up and fills up entire screen while file is printing

Minimized - program comes up and runs as an icon while file is printing

Hidden - program runs, but no icon or main window is visible while file is printing

Examples:

// runs Notepad as an icon and prints the report

Print(“C:\reports\daily.txt”,”Minimized”)

// runs Excel normally, and prints the noon spreadsheet

Print(“C:\reports\noon.xls”)

Also See:

  RunProgram


IfEquals

IfEquals(<value1>,<value2<>,<action if TRUE>)

IfEquals compares two values for equality.

Parameters: 	value1, value 2 – the two values to compare

Returns:	TRUE if action is successful; otherwise FALSE.

This function checks two values for equality. If not equal, the function returns FALSE. If equal, the function executes the action, and returns its success result.

Either value can be a variable name, and both numbers and strings can be compared. In addition, either value can reference one of the system constants as described in the IfMoreThan, IfLessThan functions.

Examples:

// order is unimportant

IfEquals(8,7,MessageBox(“Laws of math are no longer true!”))

IfEquals(7,%A,Beep())

IfEquals(%B,”Forli”,MessageBox(“Password accepted”))

// you can use system constants

IfEquals(COMPUTER_NAME,”SPARTA”,RunMacro(“system.mac”))

Also See:

  IfMoreThan

  IfLessThan


Using Variables

Using Variables

Variables are among the most powerful features of GroundControl. They allow you to store results entered by users, or calculated numbers from other programs. They can be used to store data like file sizes, text strings for registry keys, user names, or clipboard results.

There are 26 variables in GroundControl, and as you might have guessed, each variable is named after a letter of the alphabet. The variable name begins with a percent sign, so the 26 variables available to you are called %A, %B, %C, etc. You can inspect the contents of the variables at any time by selecting Macro, then Dump Variables from the menu. A faster way is to press Ctrl-Shift-D. A dialog will be displayed which shows you what the contents of all 26 variables are.

To put something into a variable, use the PutVar function. For example, to put the value six (6) into %A, you write PutVar(%A,6). If you enter this line into GroundControl, then select it and push the Test Line button, the value 6 will be stored in %A. Push Ctrl-Shift-D to see it.

You can store numbers in variables, and you can store strings of text. For example, you might want to store your name in %N. To do this, you write PutVar(%N,”Heironymus Wombat”). Text strings should be quoted if they contain more that one word, and especially if they contain commas. To be safe, you should quote text always. It doesn’t matter if you quote numbers or not, unless you are using comma separators in your numbers. For example, the following are legal:

PutVar(%A,5.6)	( fine )

PutVar(%A,”5.6”)	( also fine – decimals are accepted )

PutVar(%A,”100,000”)	( use quotes because of comma separator )

PutVar(%A,Peter)	( unquoted strings are legal but not recommended, use quotes )

PutVar(%A,”Peter”)	( better! )

PutVar(%A,Peter and Mark)	( multiple words are ok, but not recommended without quotes )

PutVar(%A,”Peter and Mark”)	( better! )

PutVar(%A,”Peter,Mark,Julie”)	( this is fine – commas are inside quotes )

PutVar(%A,Peter,Mark,Julie)	( this is illegal – commas are outside quotes )

There is a new function you can use in your macro called Dump(), which displays the variable contents message box during macro execution. This is handy for debugging.

PutVar(%C,”Test”)

Dump()

PutVar(%C,”Another test”)

// hopefully, the message box should change

Dump()

It doesn’t matter whether you use capital letters for the variable names. %A is the same as %a, so feel free to mix cases.

All this is pretty easy stuff. What do we do with variables once they are loaded?

  Using Variables in Functions


Using Variables In Functions

Using Variables in Functions

GroundControl will accept variables in place of regular function arguments. In English, this means that anywhere you would provide a function with parameters, you can put a variable instead, provided the variable contains what you were originally going to provide.

For example, suppose you want to display a message box. The easy way of doing this is:

MessageBox(“Hello, this is a sample message”)

The alternate way, using variables might look like this:

PutVar(%M,“Hello, this is a sample message”)

MessageBox(%M)

First, we load the text string into variable %M. Then, we call the MessageBox function, but instead of explicitly giving it the string we want to display, we pass the name of the variable where the string is stored. When GroundControl executes the MessageBox statement, it looks at the parameter to decide if it’s a variable or not. If it is, it replaces the %M you typed with the contents of %M instead. All variables begin with %, so GroundControl can identify them.

Let’s try another example. We will write a Repeat function using a variable %R. Here’s the original statement:

Repeat(Beep(),10)

Here’s the variable version:

PutVar(%R,10)

Repeat(Beep(),%R)

.

Again, instead of explicitly specifying ten for the repeat count, we put the value ten in variable %R, and specify %R for the repeat count. GroundControl recognizes a varaible in the Repeat statement, and substitutes the contents, which is the value ten.

You can do this to any function. Look at these examples:

1.	PutVar(%A,"Calculator")

ActivateWindow(%A)	has same effect as ActivateWindow(“Calculator”)

2.	PutVar(%A,"C:\MYFILES")

CreateDirectory(%A)	has same effect as CreateDirectory(“C:\MYFILES”)

3.	3.	PutVar(%A,”a new line of text”)
WriteToFile("mylog.txt",%A)	has same effect as WriteToFile(“mylog.txt”,”a new line of text”)

Which variables you use for which purpose is up to you. It helps to associate the variable letter with what it’s storing, so you might want to store a name in %N, a counter in %C, disk space size in %D or %S, or so on.

Why do we want to use variables? It looks as though it takes twice as many statements to do what we wanted. If we know what has to go in them before they can be used, why make two steps out of it? There are many reasons. You might want to reuse certain strings or values in multiple statements. Instead of typing in the same string, use a variable. That way, if the string ever changes, you only have to fix it in one place. A person’s name, a directory path on a drive, a maximum file size, a program name – these are all examples of something you might want to put in a variable for storage.

There are more important uses for variables. They act as temporary storage locations for data coming in and out of your macro. You just learned that any function will accept a variable for a parameter, and that it’s the contents of the variable that are substituted by GroundControl. You also learned that you use PutVar to load a variable with a value of some type. There are several other ways of getting data into variables that we haven’t looked at yet:

1. Interactive Input with InputBox

InputBox now takes an optional parameter for the variable name. The response entered by the user is stored in the variable. This means you can send their response to any function. If you ask for a filename, you can send it to DeleteFile, FindFile, WriteToIniFile, FileExist, FileOlderThan, CopyFile, etc. You can ask for a username, and log it using LogEvent, LogError, WriteToFile, etc. You could also send the username to another program using SendKeys or DDE.

For example:

InputBox(“What is your favorite color”,%C)

IfEquals(%C,”Blue”,MessageBox(“Mine too!”))

InputBox(“What is your favorite number”,%C)

IfEquals(%C,21, MessageBox(“Mine too!”))

2. System Information

There is a new function called GetSystem to return the system values identified by the system constants used in LogSystem. The function takes one parameter, the variable in which to store the result:

GetSystem(%A,DISK_C_FREE)

Dump()

GetSystem(%A,MEMORY_TOTALPHYSICAL)

Dump()

GetSystem(%A,COMPUTER_NAME)

Dump()

3. File Size

You can retrieve the size of a file in bytes via the GetFileSize function. The first parameter is the name of a file, the second is the variable in which to store the result. For example, the following will write the size of the autoexec.bat file to a logfile:

GetFileSize( “c:\autoexec.bat”,%B)

WriteLineToFile(“mylog.txt”,”The file size is: “)

WriteLineToFile(“mylog.txt”,%B)

This created file will look like this:

The file size is:	1196

Notice in the above example that the text “mylog.txt” was used twice. Here is a place where a storage variable could be used. For example:

GetFileSize( “c:\autoexec.bat”,%B)

PutVar(%F,“mylog.txt”)

WriteLineToFile(%F,”The file size is: “)

WriteLineToFile(%F,%B)

4. Reading the Clipboard

There is a new function to pull the contents of the ClipBoard into a variable. Simply specify the variable to use:

GetClipBoard(%C)

Dump()

This is useful if you want to send a copy command to another application to have it copy some results you want to the ClipBoard, and then pull them into your macro with GetClipBoard(). This only works if the contents of the ClipBoard are in text format.

5. Reading the Registry

You can use GetFromRegistry() to pull values from the registry. You need three parameters, one for the registry path, one for the item you want to retrieve, and one specifying the variable where you want the result placed:

GetFromRegistry("HKEY_LOCAL_MACHINE\SYSTEM\SETUP","cmdline",%B)

Dump()

Registry key/paths tend to become long in a hurry. If you have multiple reads to perform from the same key/path, use a variable to store the key/path, and your macro will be much more readable:

PutVar(“%K”,”HKEY_LOCAL_MACHINE\SYSTEM\SETUP”)

GetFromRegistry(%K,"cmdline",%A)

GetFromRegistry(%K,"systempartition",%B)

GetFromRegistry(%K,"systemprefix",%C)

GetFromRegistry(%K,"setuptype”,%D)

Dump()

Use extreme caution when working within the registry!

6. Reading INI files

You can use ReadFromIniFile() to pull values from INI files. You need three parameters, one to specify the file and one for the section and item. The last parameter is the variable where the result should be placed. This is powerful because you can use your own ini files to store variables or results of any  kind. Suppose you ran a macro every morning to monitor disk space. You can use your own ini file to store the disk space each day, so you can see if you are running out. Let’s create a file called monitor.ini, and store the disk space in a section called “diskspace”, and keep one entry for each drive on your system. The ini file looks like this:

[diskspace]

cdrive=142351362

ddrive=1235112355

edrive=45236418

The macro will check the disk space every morning, then compare it to yesterday’s values stored in the ini file. It will then have to write the new disk spaces back into the ini file for the next day.

// get yesterdays space on disk c, put it in %Y

GetFromIniFile("C:\gc\monitor.ini","[diskspace]cdrive”,%Y)

// get todays space into %T

GetSystem(%T,DISK_C_FREE)

// warn the user

IfLessThan(%T,%Y,LogEvent(“Less space than yesterday on C drive”))

//update the ini file with the new value

WriteToIniFile(“C:\gc\monitor.ini”,”[diskspace]cdrive”,%T)

// repeat this code for other drives …

Of course, you can go crazy with variations of files, sections, and items. Ini files allow a ton of flexibility for permanently storing data.

7.	7.	Incrementing and Decrementing

There may be instances when you want to use variables as counters, to track how often a macro or function has been called. The new Increment and Decrement functions allow you to do this easily.

PutVar(%A,0)

Increment(%A)

Increment(%A)

Increment(%A)

Decrement(%A)

// %A should be 2


DeleteFile

DeleteFile(<pathname>)

DeleteFile deletes the specified file

Parameters: 	pathname – specifies the original file

Returns:	TRUE if successful; otherwise FALSE.

This function deletes a file. Simply specify the file, and optionally a path. If no path is specified, the working directory will be used.

Examples:

DeleteFile("C:\autoexec.tmp”)

Also See:

  MoveFile

  CopyFile

  DeleteFile

  FindFile


What's new in Version 1.02?

GroundControl Version 1.02 includes several powerful new features:

1.	Variable support allows internal manipulation of numbers and text. To get started with variables, read the tutorial on Using Variables . Any GroundControl functions which take parameters will inherently support variables, including all functions supported prior to Version 1.02.

2.	Advanced file and directory functions allow you to search for files, perform cross-volume copies, and create and delete your own directories as needed.

3.	Ini file and registry access for storing and reading settings and values. These are used in conjunction with variables, so check out the Using Variables tutorial.

We feel that these new GroundControl will greatly add to your programming potential. Please feel free to let us know what you think.


LogEvent

LogEvent(<message>)

LogEvent writes an entry in the event log file

Parameters:	message - Specifies the text to be written to the log file.

Use LogEvent to write custom event messages with a time and date stamp to the default log file, called macsys.log. Your macro can handle events and post messages to the event log based on conditions in the macro. This is useful for tracing automated jobs. The log file looks something like this:

01/24/97 19:50:20 User said no to my dialog box

01/24/97 19:50:25 The Calculator program wasn't running.

LogEvent works just like LogError except that different files are used. This allows the separation of normal messages from serious events.

Examples:

:LabelA

LogEvent("Executing at Label A")

Also See:

  LogError

  LogSystem


Increment

Increment(<variable>)

Increment adds one to the specified variable

Parameters:	variable- Specifies the variable in increment.

Use Increment to add one (1) to a variable. This is useful for logging, debugging, etc. Used in conjunction with Decrement, these two functions can let you count how many times a particular macro file or function block is called.

Examples:

// Set %C to 3

PutVar(%C,3)

// Add one

Increment(%C)

// Now %C should be 4

MessageBox(%C)

Also See:

  Decrement


Decrement

Decrement(<variable>)

Decrement subtracts one from the specified variable

Parameters:	variable- Specifies the variable in increment.

Use Decrement to subtract one (1) from a variable. This is useful for logging, debugging, etc. Used in conjunction with Increment, these two functions can let you count how many times a particular macro file or function block is called.

Examples:

// Set %C to 3

PutVar(%C,3)

// Subtract one

Decrement(%C)

// Now %C should be 2

MessageBox(%C)

Also See:

  Increment


IsFileLocked

IsFileLocked(<file name>)

IsFileLocked checks to see if a file is open by a process

Parameters:	variable- Specifies the variable in increment.

Use IsFileLocked when you want to check that a file is available for moving, deleting, opening, etc. When a process has a file open for reading or writing, GroundControl is unable to copy or delete it. This function lets you test for a file being used, and so avoid locking problems:

For example, the “gc.exe” file is loaded into memory whenever you run GroundControl. If you write a macro that tries to delete “gc.exe”, it will fail because the file is always locked. You can use IsFileLocked to examine the state of the GroundControl file as follows ( your path may be different ):

// this should always beep

If(IsFileLocked("c:\gc\gc.exe"),Beep())

This function is most useful for situations where you are waiting for a file to be created so you can further process it. Simply checking for it to exist will not work if the file takes a while to create. You actually need the process that is creating the file to finish with it before you take control IsFileLocked does this.

Examples:

If(IsFileLocked(“Q:\DATA\DOWNLOAD.DAT”),GoTo(“:Import”),GoTo(“:Wait”))

Also See:

  FileExist


What's New Iin Version 1.03
What's New In Version 1.03

GroundControl Version 1.03 includes the following new features:

1.	New functions for Decrementing and Incrementing variable counters.

2.	New IsFileLocked function to examine for a file being locked by another process.

3.	FindWindow includes wildcard support.

Check out the New Features in 1.02 in case this is your first time. Got any other suggestions? Let us know!


Command Line Parameters

GroundControl supports command line parameters. By default, if you specify a filename, GroundControl will attempt to load BUT NOT EXECUTE the macro file.

> gc.exe mymacro.gc

Because .gc files are registered as GroundControl specific, you can just type the file name if you want to load the file:

> mymacro.gc

If you want to load AND EXECUTE the macro, specify “/r” before the filename. You need the gc.exe in this case:

> gc.exe /r mymacro.gc


GetDate

GetDate(<variable>)

GetDate returns the date in MM/DD/YY format into the variable specified.

Parameters:	variable- Specifies the variable to store the date in.

Use GetDate to get the system date. This can be used by one of the IsDate functions, or for other variable purposes, like sending keys, messaging. Logging, etc.

Year 2000:  GetDate returns a two digit year date (mm/dd/yy).  For backwards compatability, the GetDate function has not been changed.  However, GroundControl will correctly evaluate a date returned by GetDate after 12/31/99 as ‘after.’  If you need to return a date and are concered with year 2000 issues, use the GetDateTime function.  The GetDateTime function enables you to return a date in many different date formats.

Examples:

GetDate(%D)

MessageBox(%D)

Also See:

  GetDateTime

  IsDateBefore

  IsDateAfter

  IsDateEqual

  IsDateBetween


GetTime

GetTime(<variable>)

GetTime returns the time in HH:MM:SS format into the variable specified.

Parameters:	variable- Specifies the variable to store the time in.

Use GetTime to get the system time. This can be used by one of the IsTime functions, or for other variable purposes, like sending keys, messaging. Logging, etc.

Time is returned in 24 hour format. If you want other time functions, see GetDateTime.

Examples:

GetTime(%X)

MessageBox(%X)

Also See:

  GetDateTime

  IsTimeAfter

  IsTimeBefore

  IsTimeEqual

  IsTimeBetween


GetDateTime

GetDateTime(<variable>,<format string>[,relative date])

GetDateTime returns the date/time in a user specified format into the variable specified.

Parameters:	variable- Specifies the variable to store the date/time in.

format string- Specifies the format to create the answer string

relative date – Optionally specifies which date to retrieve

Use GetDateTime to get the system date and/or time in any format you choose. The time formats can be found under Date and Time Formats . It is merely a string with % codes embedded which specifiy what time/date to include, and how they should appear.

Don’t confuse the %x in the first parameter ( meaning a variable to put the answer in ) with the %x’s in the second parameter ( specifying the components to include in the answer string ).

The third parameter lets you define which date and time you want. If you don’t specify it, GroundControl returns the current date and time. You can use one of the following, however, to specify a relative date and time:

TODAY	Current time

YESTERDAY	Curernt time minus 24 hours

DAYBEFOREYESTERDAY	Current time minus 48 hours

TOMORROW	Current time plus 24 hours

DAYAFTERTOMORROW	Current time plus 48 hours

ONEWEEKAGO	Current time minus seven days

ONEWEEKFROMNOW	Current time plus seven days

FIRSTDAYTHISMONTH	First day of minth at current time

LASTDAYTHISMONTH	Last day of month at current time

FIRSTDAYPREVMONTH	First day of previous month at current time

LASTDAYPREVMONTH	Last day of previous month at current time

Examples:

// use variable %X for the answer

GetDateTime(%X,”%H:%M:%S”)

MessageBox(%X)

// %X now contains “11:31:00”

GetDateTime(%B,”%B”)

// %B now contains “November”,or your current month!

// use relative time – assume “now” is 2/11/1998

GetDateTime(%A,"%m/%d/%y",TODAY)

// %A contains “02/11/1998”

GetDateTime(%B,"%m/%d/%y",TOMORROW)

// %B contains “02/12/1998”

GetDateTime(%C,"%m/%d/%y",FIRSTDAYTHISMONTH)

// %C contains “02/01/1998”

Also See:

  GetTime

  GetDate

  Date and Time Formats


MouseClickScreen

MouseClickScreen(<x coordinate>,<y coordinate>)

MouseClickScreen sends a mouse click to the window at the specified screen location.

Parameters:	x coordinate – pixels across from top left corner of screen

y coordinate – pixels down from top left corner of screen

Use MouseClickScreen to activate another window, or a control within a window.

To determine the x and y corrdinates of the mouse pointer you can use the MouseTrack utility included with GroundControl

Examples:

MouseClickScreen(200,25)

SendKeys(“text”)

MouseClickScreen(200,50)

SendKeys(“123”)

Also See:

  MouseDblClickScreen


MouseDblClickScreen

MouseDblClickScreen(<x coordinate>,<y coordinate>)

MouseDblClickScreen sends a mouse double click to the window at the specified screen location.

Parameters:	x coordinate – pixels across from top left corner of screen

y coordinate – pixels down from top left corner of screen

Use MouseClickScreen to activate another window, or a control within a window.

To determine the x and y corrdinates of the mouse pointer you can use the MouseTrack utility included with GroundControl

Examples:

MouseDblClickScreen(200,25)

SendKeys(“text”)

MouseDblClickScreen(200,50)

SendKeys(“123”)

Also See:

  MouseClickScreen


IsDateBefore

IsDateBefore(<date string A>,<date string B>)

IsDateBefore compares two dates, and returns TRUE if the first is before the second.

Parameters:	date string A – in format MM/DD/YYYY

date string B – in format MM/DD/YYYY

Use IsDateBefore to perform tasks based on date. You can get the current date with GetDate. Either date parameter can be a variable.

Examples:

GetDate(%E)

If(IsDateBefore(%E,”12/25/1998”),MessageBox(“Today is BEFORE Christmas ‘98”))

If(IsDateBefore(”11/11/1918”,%E),MessageBox(“Today is AFTER World War I”))

Also See:

  GetDate

  IsDateAfter

  IsDateEqual

  IsDateBetween


IsDateAfter

IsDateAfter(<date string A>,<date string B>)

IsDateAfter compares two dates, and returns TRUE if the first is after the second.

Parameters:	date string A – in format MM/DD/YYYY

date string B – in format MM/DD/YYYY

Use IsDateAfter to perform tasks based on date. You can get the current date with GetDate. Either date parameter can be a variable.

Examples:

GetDate(%E)

If(IsDateAfter(%E,”12/25/1998”),MessageBox(“Today is BEFORE Christmas ‘98”))

Also See:

  GetDate

  IsDateBefore

  IsDateEqual

  IsDateBetween


IsDateEqual

IsDateEqual(<date string A>,<date string B>)

IsDateEqual returns TRUE if the first date is equal to the second.

Parameters:	date string A – in format MM/DD/YYYY

date string B – in format MM/DD/YYYY

Use IsDateEqual to perform tasks based on date. You can get the current date with GetDate. Either date parameter can be a variable.

Examples:

GetDate(%E)

If(IsDateEqual(%E,”02/14/1998”),MessageBox(“Happy Valentine’s Day”))

Also See:

  GetDate

  IsDateBefore

  IsDateAfter

  IsDateBetween


IsDateBetween

IsDateBetween(<date string A>,<date string B>,<date string C>)

IsDateBetween returns TRUE if the first date is between the second and third dates ( not inclusive ).

Parameters:	date string A – in format MM/DD/YYYY

date string B – in format MM/DD/YYYY

date string C – in format MM/DD/YYYY

Use IsDateBetween to perform tasks based on date. You can get the current date with GetDate. Any parameter can be a variable.

Examples:

GetDate(%E)

If(IsDateBetween(%E,”11/01/1998”,”11/07/1998”),GoTo(“:RUNMACRO”))

Also See:

  GetDate

  IsDateBefore

  IsDateAfter

  IsDateEqual


IsTimeBefore

IsTimeBefore(<time string A>,<time string B>)

IsTimeBefore compares two times, and returns TRUE if the first is before the second.

Parameters:	time string A – in format HH:MM:SS

time string B – in format HH:MM:SS

Use IsTimeBefore to perform tasks based on time. You can get the current time with GetTime. Either time parameter can be a variable.

24 hour time is assumed unless you explicitly include a PM in the time string.

Examples:

GetTime(%E)

If(IsTimeBefore(%E,”12:00:00”),MessageBox(“This is before noon”))

If(IsTimeBefore(%E,”11:00:00”),MessageBox(“This is before 11:00 AM”))

If(IsTimeBefore(%E,”23:00:00”),MessageBox(“This is before 11:00 PM”))

If(IsTimeBefore(%E,”11:00:00 PM”),MessageBox(“This is also before 11:00 PM”))

Also See:

  GetTime

  IsTimeAfter

  IsTimeEqual

  IsTimeBetween


IsTimeAfter

IsTimeAfter(<time string A>,<time string B>)

IsTimeAfter compares two times, and returns TRUE if the first is after the second.

Parameters:	time string A – in format HH:MM:SS

time string B – in format HH:MM:SS

Use IsTimeAfter to perform tasks based on time. You can get the current time with GetTime. Either time parameter can be a variable.

24 hour time is assumed unless you explicitly include a PM in the time string.

Examples:

GetTime(%E)

If(IsTimeAfter(%E,”12:00:00”),MessageBox(“This is after noon”))

If(IsTimeAfter(%E,”11:00:00”),MessageBox(“This is after 11:00 AM”))

If(IsTimeAfter(%E,”23:00:00”),MessageBox(“This is after 11:00 PM”))

If(IsTimeAfter(%E,”11:00:00 PM”),MessageBox(“This is also after 11:00 PM”))

Also See:

  GetTime

  IsTimeBefore

  IsTimeEqual

  IsTimeBetween


IsTimeEqual

IsTimeEqual(<time string A>,<time string B>)

IsTimeEqual compares two times, and returns TRUE if the first is equal to the second.

Parameters:	time string A – in format HH:MM:SS

time string B – in format HH:MM:SS

Use IsTimeEqual to perform tasks based on time. You can get the current time with GetTime. Either time parameter can be a variable. The times must match down to the second!

24 hour time is assumed unless you explicitly include a PM in the time string.

Examples:

GetTime(%E)

If(IsTimeEqual(%E,”12:00:00”),MessageBox(“This is equal to noon”))

If(IsTimeEqual(%E,”11:00:00”),MessageBox(“This is equal to 11:00 AM”))

If(IsTimeEqual (%E,”23:00:00”),MessageBox(“This is equal to 11:00 PM”))

If(IsTimeEqual(%E,”11:00:00 PM”),MessageBox(“This is also equal to 11:00 PM”))

Also See:

  GetTime

  IsTimeAfter

  IsTimeBefore

  IsTimeBetween


IsTimeBetween

IsTimeBetween(<time string A>,<time string B>,<time string C>)

IsTimeBetween returns TRUE if the first time is between the second and third times ( not inclusive ).

Parameters:	time string A – in format HH:MM:SS

time string B – in format HH:MM:SS

time string C – in format HH:MM:SS

Use IsTimeBetween to perform tasks based on time. You can get the current time with GetTime. Any parameter can be a variable.

24 hour time is assumed unless you explicitly include a PM in the time string.

Examples:

GetTime(%E)

If(IsTimeBetween(%E,”00:00:00”,”08:00:00”),MessageBox(“EARLY MORNING SHIFT”))

If(IsTimeBetween(%E,”08:00:00”,”17:00:00”),MessageBox(“DAYTIME HOURS”))

If(IsTimeBetween(%E,”17:00:00”,”23:59:59”),MessageBox(“EVENING SHIFT”))

Also See:

  GetTime

  IsTimeAfter

  IsTimeBefore

  IsTimeEqual


Pricing

Cost for GroundControl is $39.95 for a single licensed copy. Upon payment you will receive a registration number that will remove the shareware screen which appears each time GroundControl is started. For an additional cost you can also receive a diskette with the latest version of GroundControl. This cost is dependent on where the diskette will be shipped.

Diskette Cost:

United States	$ 6.00

Mexico and Canada	$ 8.00

All Others	$10.00

Site Licensing

Site licensing is available based on the pricing structure below. A site licensing agreement receives 1 copy of the application diskette and allows you to make up to the number of copies you order. For additional information on ordering a site license contact Acrasoft Technologies by any of the listed in the support section of this file,

Site License:

05 to 24 	computers: $31.95 each

25 to 49 	computers: $28.95 each

50 to 99 	computers: $26.95 each

100+	computers: Call


Order Form

Name   : __________________________________________________

Company: __________________________________________________

Address: __________________________________________________

City   : _____________________ State:____ Zip Code:________

Registration Name: ________________________________________

(6 character minimum, 32 character maximum)

(If different than purchaser name)

E-mail Address: ____________________________

Phone Number  : ____________________________

Product:      GroundControl                                  ( Item 15152 )

Num. Copies_____   at _______ each          = _____________

CA Residents add local sales tax (7.25%)    + _____________

Please indicate whether or not a 3.5" diskette copy is

being ordered. Add the additional cost for shipping and

handling to the total.

Diskettes Yes:___ No: __

United States........................$ 6.00

Mexico and Canada....................$ 8.00

All Others...........................$10.00 + _____________

                                                                          Total Amount   ______________

Send Completed Form and Payment To:

Acrasoft

4450 California Ave. #278

Bakersfield, CA 93309


Ordering by Check or Money Order

Print and Fill Out the order form and mail with check or money order to:

Acrasoft

4450 California Ave. #278

Bakersfield, CA 93309

To Print the order form click on Order Form from the content page and pull down the help file menu and select print topic.

Note! Payments must be made in US dollars and drawn on a US bank.


Ordering by Credit Card

You can order with MC, Visa, Amex, or Discover from Acrasoft by calling the number below or by using the "Online Registration" available from our web site at http://www.acrasoft.com or by telephone at:

800-242-4775 extension 15152

713-524-6394 extension 15152

You can send a fax to the following number. Be sure you include the item number 15152 on the fax so we know which product you want.

713-524-6398 (fax)

Also you will need to specify whether or not you want a diskette copy.

THE ABOVE NUMBERS ARE FOR ORDERS ONLY. Any questions about the status of the shipment of the order, registration options, product details, technical support, volume discounts, dealer pricing, site licenses, etc., must be directed to Acrasoft at e-mail address support@acrasoft.com or the address below.

Acrasoft

4450 California Ave. #278

Bakersfield, CA 93309


Purchase Order

Purchase orders (net 30 days) are accepted only from government agencies, accredited educational institutions and major corporations based in the USA only, provided that they are submitted on purchase order forms with a purchase order number.  Please be sure to include the standard GroundControl order form with each purchase order.

Send the Purchase Order and the Order Form to:

Acrasoft

4450 California Ave. #278

Bakersfield, CA. 93309

Or you can fax both the purchase order and the completed order form to:

Acrasoft

805 665-2807


What's New in Version 2.00?

GroundControl Version 2.00 includes 18 new powerful commands, which brings the total to 88! Eleven of these are for manipulating dates and times. These allow you to perform tasks only during certain dates, or certain times of the day. Here’s a few to look at:

  GetTime

  GetDate

  IsDateBefore

Other new features include the ability to control the CAPS lock key, and send mouse clicks to the screen automatically.

  SetCapsLock

  MouseClickScreen

  MouseDblClickScreen

The FileExist function has been augmented by supporting wildcards.

  FileExist

New functions exist for reading lines out of text files into variables, up to three files at once.

  OpenFile

  CloseFile

  ReadLine

In other news … the problem with GroundControl breaking out of infinite loops has been fixed!


OpenFile

OpenFile(<buffer id><filename>)

OpenFile opens a text file for reading lines from.

Parameters:	buffer id – unique identifier for this file

filename - name of file to open

Use OpenFile to open a text file for reading lines from with the ReadLine function. When finished, call the CloseFile function.

You can open up to three files simultaneously for reading. Each must be identified with a unique buffer id ( 0, 1, or 2 ). You refer to this buffer id when calling the ReadLine and CloseFile functions, so GroundControl knows which file you are referring to.

GroundControl remembers where you are in each file, so you can only read lines in the forward direction, and you can’t write to a file you are currently reading from.

Once the text is in a variable, you can use it in SendKeys, write it to another file, or any other GroundControl function that uses text.

Examples:

// read first line out of myfile.txt into variable %A

OpenFile(0,”c:\myfile.txt”)

ReadFile(0,%A)

CloseFile(0)

MessageBox(%A)

Also See:

  CloseFile

  ReadLine


CloseFile

CloseFile(<buffer id>)

CloseFile closes a text file previously opened with OpenFile.

Returns: 	TRUE if the file is closed successfully; otherwise FALSE.

Parameters:	buffer id – unique identifier for this file

Use CloseFile to close a text file opened with OpenFile . The buffer id must be 0, 1, or 2.

You do not have to call CloseFile if you have been using the WriteLineToFile family of functions.

Examples:

// read first line out of myfile.txt into variable %A

OpenFile(0,”c:\myfile.txt”)

ReadLine(0,%A)

CloseFile(0)

MessageBox(%A)

Also See:

  OpenFile

  ReadLine


ReadLine

ReadLine(<buffer id><variable>)

ReadLine reads a line of text from a text file previously opened with OpenFile.

Parameters:	buffer id – unique identifier for this file

variable – where the text should be placed

Use ReadLine to read a line of text from a text file opened with OpenFile. The buffer id must be 0, 1, or 2.

If there is an error reading the file, or the end of the file is reached, this function returns FALSE.

Examples:

// readlines out of autoexec.bat into variable %B, and display total in %A

PutVar(%a,0)

OpenFile(1,"c:\autoexec.bat")

:Loop

If(ReadLine(1,%b),DoNothing(),Goto(":Exit"))

Increment(%a)

MessageBox(%b)

Goto(":Loop")

:Exit

CloseFile(1)

MessageBox(%a)

Also See:

  OpenFile

  CloseFile


DoNothing

DoNothing()

DoNothing does nothing!

Parameters:	None

DoNothing is simply a No-Operation function. It can be used to fill in an If statement if you are uncomfortable with the NOT operator , the exclamation mark(!). If you want to trigger on a condition being FALSE instead of TRUE, the DoNothing function can fill in the TRUE part of the If statement.

Examples:

// wait for the file myfile.txt to go away before proceeding

:WAIT

If(FileExist(”C:\myfile.txt”),DoNothing(),GoTo(“:READY”))

Delay(1000)

GoTo(“:WAIT”)

:READY

// take action


SetCapsLock

SetCapsLock(<ON or OFF>)

SetCapsLock sets or resets the CAPS key on the keyboard.

Parameters:	variable- ON or OFF  to set the CAPS Lock

Use SetCapsLock to change the state of the CAPS key. This is useful when sending keys to another application.

Examples:

// force upper case

SetCapsLock(ON)

SendKeys(“hello”)

Message Parse is designed to provide an easy and effective way of capturing data from your email messages and making that data available to other applications you use. Message Parse creates delimited output files from the captured data, ready for import to other applications like spreadsheets, accounting packages, and database applications. With User defined filtering and search criteria there is virtually no limit to the possibilities. Mail listings, processing online orders and archiving information are just a few of the things that can be done with Message Parse.

Message Parse can be configured to use either POP3 connections or a MAPI compliant mail client (like MS Exchange client "Windows Messaging" or MS Outlook 97) as the message source.

An absolute time saver for anyone conducting any kind of business via email.


LaunchPad

As you can see, LaunchPad provides a clear display of all the scheduled events, which you can sort either by ` you move around quickly. You can choose your own font for the display, and save your settings. Events are easily edited by double-clicking any event in the list.

LaunchPad's tabbed display steps you through editing events from the simple once-only pop-up messages to the complex DDE scripts to a remote server scheduled on a condition trigger. A wide variety of scheduling options let you avoid pitfalls of fixed-time schedules (like those unfriendly jobs that take longer than expected and interfere with the next job). You can chose to retry the job next time around, or run it anyway, and delete or disable the job after it's done. If you've got a convoluted schedule to execute, this is the tool to handle it.

With its ability to save different schedule files, LaunchPad can be used on the same machine by multiple people with different needs, and switches between monthly shifts, etc., are easily made. Multiple log files are also supported, so tracking down problems (i.e. did that program run last night or not?) is much easier. LaunchPad can continually "sniff" for a new schedule file, so you don't have to stop it to make schedule changes.

LaunchPad supports scheduling options like day of month, last day of month or work days (i.e. Mon., Wed, Fri.). In Addition, LaunchPad is a DDE server. LaunchPad can both send and receive DDE commands to control its own events or control other applications. Send Keys now has more features including additional timing support, activation and control of applications and a stop command. LaunchPad also supports forced reboots for restarting a computer without being stopped by dialog boxes or even users. Support is now available for the Internet - simply enter your URL's at the command line for scheduled downloads. The message dialog box has a new timer feature that will display the pop-up message for a pre-determined time. As you can see, LaunchPad sets new standards for application automation.

LaunchPad's versatility is there for your needs and imagination. Let the LaunchPad Scheduler work around the clock...so you don't have to. LaunchPad sells for $29.95 plus s/h. Site-licenses are welcome.


GetFileDateTime

GetFileDateTime(<variable>,<file>,<format string>)

GetFileDateTime returns the modification date of the specified file in the variable.

Parameters:	variable - where the date time string is returned

file - which file to examine

format string – how to return the answer

Use GetFileDateTime to return the change date of a file as a string. The format string is exactly the same as for GetDateTime . Using a format string allows you to select only the parts of the date or time you are interested in.

Examples:

// for example

GetFileDateTime(%F,”c:\autoexec.bat”,”%m/%d/%y”)

Also See:

  GetFileSize

  GetDateTime

  SendNow


AddString

AddString(<variable1>,<variable2>)

AddString adds the second variable string to the end of the first. This is called concatenation or appending.

Parameters:	variable1 – variable that gets changed

variable2 – variable that gets appended

Use AddString to add the contents of a variable to the end of another. This is a string operation, not a numerical one!

Examples:

// a polite messagebox

PutVar(%A,”Hello, ”)

InputBox(”Type your name please”,%N)

AddString(%A,%N)

MessageBox(%A)

// add string is not numerical:

PutVar(%X,”1”)

AddString(%X,”2”)

MessageBox(%X)

// %X will contain “12”, not “3”

Also See:

  Variables


What's New in Version 2.02?

GroundControl Version 2.02 includes a couple of enhancements. First, the RunProgram command now supports long filenames, specifically, directory names with spaces. If you had problems with RunProgram launching Windows Explorer, this one’s for you. Second, GetDateTime now supports relative identifiers, lke “TOMORROW”, “LASTDAYOFMONTH”, etc. to help you with jobs needing certain time restrictions.

This release also sports two new shiny functions:

GetFileDateTime for checking file change dates and times.

AddString for appending one string to the end of another.

Let us know what else you need!


DdeOpen

DdeOpen(<buffer id>,<app>,<topic>)

DdeOpen opens a DDEconversation to the specified app and topic.

Parameters:	buffer id – unique identifier for this conversation

app - name of server to connect to.

topic – topic to connect to

Use DdeOpen to open a DDE conversation for reading values from with the DdeRead function. When finished, call the DdeClose function.

The app parameter may also be of the form “\\node\app” if the server is on a remote machine.

You can open up to three conversations simultaneously for reading. Each must be identified with a unique buffer id ( 0, 1, or 2 ). You refer to this buffer id when calling the DdeRead and DdeClose functions, so GroundControl knows which conversation you are referring to.

If you have several points to read from a single link, you will benefit by leaving the link open until you are done with it. If your macros are fairly convoluted, you may want to open your links first, and close them all when the macro exits.

Once the text is in a variable, you can use it in any other GroundControl function that uses variables.

Examples:

// this opens the conversation

DdeOpen(1,"excel","[book1.xls]Sheet2")

// this reads a value from the cell

DdeRead(1,"R10C2",%A)

// this closes the link

DdeClose(1)

Dump()

Also See:

  DdeClose

  DdeRead

  DDE Overview


DdeClose

DdeClose(<buffer id>)

DdeClose closes the DDE conversation in the given buffer.

Parameters:	buffer id – unique identifier for this conversation

Use DdeClose to close a DDE link opened with DdeOpen. The buffer id must be 0, 1, or 2.

Examples:

// this opens the conversation

DdeOpen(1,"excel","[book1.xls]Sheet2")

// this reads a value from the cell

DdeRead(1,"R10C2",%A)

// this closes the link

DdeClose(1)

Dump()

Also See:

  DdeOpen

  DdeRead

  DDE Overview


DdeRead

DdeRead(<buffer id>,<item>,<variable>)

DdeRead reads a value from the DDE conversation in the given buffer into the variable.

Parameters:	buffer id – unique identifier for this conversation

item – the DDE item to read

variable – where the item value is placed

Use DdeRead to pull a single data value from the DDE item through a DDE link opened with DdeOpen. The buffer id must be 0, 1, or 2.

You can read simple value types, like integers, boolean values, floating point numbers, and strings.

Examples:

// this opens the conversation

DdeOpen(1,"excel","[book1.xls]Sheet2")

// this reads a value from the cell

DdeRead(1,"R10C2",%A)

// this closes the link

DdeClose(1)

Dump()

Also See:

  DdeOpen

  DdeClose

  DDE Overview


What's New In Version 2.03?

DDE Extensions! We have enhanced our DDE library to include the ability to run three simultaneous DDE conversations, and read data values from any DDE server, including those running on other machines!

DdeOpen 	for opening a converation

DdeClose 	for closing a conversation

DdeRead 	for reading a value from the server

Also, remember to keep checking our website for updates:

www.acrasoft.com


What's New in Version 2.04?

Added MouseTrack mouse position utility.  MouseTrack displays the x y corrdinates of the mouse pointer.  This utiliy is useful for determining parameters for MouseClickScreen and MouseDblClickScreen .

Fixed 255 character limit on string variables.  Now, string variables are only limited by the amount available memory.

Fixed DDE inconsistency.

Fixed year 2000 issue with two digit dates.

Modified the shareware screen to display only when the GroundControl editor is executed during the evaluation period.

The shareware screen will not display when the macro is run with the ‘/r’ command line switch for the first 30 days.  This feature will enable users to test their macros without manual intervention for the evaluation period.

Added start and end of previous month to GetDateTime function.

Also remember to keep checking the Acrasoft website often for updates and new products.

www.acrasoft.com


Date Time Formats

%a	Abbreviated weekday name  = Mon

%A	Full weekday name = Monday

%b   	Abbreviated month name = Feb

%B   	Full month name = February

%c   	Date and time representation appropriate for locale = 02/10/97 19:58:35

%d   	Day of month as decimal number (01 – 31) = 10

%H   	Hour in 24-hour format (00 – 23) = 19

%I   	Hour in 12-hour format (01 – 12) = 07

%j   	Day of year as decimal number (001 – 366) = 041

%m   	Month as decimal number (01 – 12) = 02

%M   	Minute as decimal number (00 – 59) = 58

%p   	Current locale’s A.M./P.M. indicator for 12-hour clock = PM

%S   	Second as decimal number (00 – 59) = 35

%U   	Week of year as decimal number,  with Sunday as first day of week (00 – 51) = 06

%w   	Weekday as decimal number (0 – 6; Sunday is 0) = 1

%W   	Week of year as decimal number, with Monday as first day of week (00 – 51) = 06

%x   	Date representation for current locale = 02/10/97

%X   	Time representation for current locale = 19:58:36

%y   	Year without century, as decimal number (00 – 99) = 97

%Y   	Year with century, as decimal number = 1997

%z, %Z	Time-zone name or abbreviation; no characters if time zone is unknown = Pacific


Year 2000 Compliance

For the latest year 2000 compliance information viste our website at http://www.acrasoft.com/y2k.html


How do I run my new macro.

By default if you open a GroundControl macro, the macro will be displayed the GroundControl editor.  This feature is great if you are developing and testing your macro, but it is not practical or useful to run it this way once you have completed your macro.  You will want to execute your macro so that it will perform the task you created it to do.  The way to do this is to use the ‘/r’ command line parameter. By including the ‘/r’ parameter on the command line before the name of the macro file, GroundControl will execute the macro without displaying the editor. GroundControl will insert the ‘stop macro icon’ in the system tray.  If you click this icon GroundControl will halt the execution of the macro.  This is important because if something goes wrong with your macro this is the only way to stop a running macro executed from the command line.  GroundControl is designed as an easy to use full featured automation utility.  GroundControl is not a development tool to create stand-alone appliactions.  GroundControl macros cannot be compiled or run outside of the GroundControl program.


(Not Operator " ! ")

You can use an excamation point before a logical test in an 'if' statement to reverse the logic.  An example would be if(!RunProgram("notepad.exe",Normal),GoTo("ErrorHandler")).  In this example if notepad fails to run, the macro execution will continue at the 'ErrorHandler' lable.


Can I compile GroundControl macros?

GroundControl is a scripting utility for automating tasks.  It was designed primarily as a tool to be used either stand alone, or with a task scheduler to automate common tasks easily without a lot of complicated programming. In it you will find functions to perform operations such as running a program, executing a DOS command and sending keys to a running application. You will also find functions for checking conditions such as if a file exists or when disk space is low.

GroundControl is not a programming language for compiling your own programs for distribution, such as Visual Basic or C++. It is a tool for editing and executing your own macro/script files that you build from GroundControl’s command set, but you must have a copy of GroundControl installed on each machine that you wish to execute those scripts on. You cannot turn those scripts into exe files for distribution. If what you are looking for is a tool that you can use to quickly and easily build scripts to perform tasks then check out GroundControl.


How do I register GroundControl

After you have evaluated GroundControl and you have decided to purchase a license, choose one of the ordering options in the “Ordering Information ” section of this help file or at our website http://www.acrasoft.com/order.html.  After we receive your order information, we willl send you a registration name and number via e-mail.  Once you receive your registration name and number,start GroundControl, you will be presented with a dialog that has a "Register" button. Click this button and enter the registration name and number.

After entering this information, hit the OK button. If you entered the information correctly, you will have successfully registered the product.

Keep this information in a safe place. If you ever move GroundControl to

another PC, you will have to re-enter this information.  Next time you run GroundControl.


What can I use GroundControl for?

GroundControl is a scripting utility for automating tasks.  It was designed primarily as a tool to be used either stand alone, or with a task scheduler to automate common tasks easily without a lot of complicated programming. In it you will find functions to perform operations such as running a program , executing a DOS command and sending keys to a running application. You will also find functions for checking conditions such as if a file exists or when disk space is low.

GroundControl is not designed for any specific purpose, but it provides a wide range of functionality through its command set. It is up to you to apply it to whatever ends you have in mind. If you aren’t sure if GroundControl is suitable for your needs, try it first!  If you get 95% of the way there, maybe we can help you get the rest of the way.  The important thing is for you to look at the command set, and see if therei s a way for you to make GroundControl do what you need.  There probably is!


Can I run DOS commands and batch files?

Yes!  If you want to execute single DOS commands, you can use the RunDOSCommand() function.  If you want to execute a batch file, use the RunProgram() command. You can even run your batch file hidden so that it does not interrupt the application running in the foreground. Simply set the run style to hidden.  Just about everything possible in DOS is available as a GroundControl function, so you shouldn’t find yourself restricted in any way.


Does GroundControl use the registry?

GroundControl has full registry awareness. You can create and change any hive/key that you have access to, using the WriteToRegistry() and GetFromRegistry() functions. You also can read and write to ini files, which may be easier (and safer) for some applications than working with the registry.


Does GroundControl support long filenames?

Yes, although you need to be aware of some of the ramifications of this. GroundControl supports both long filenames ( that is, more than 8.3 ), and file names with spaces. You must be aware, however, that because of the way Windows itself works, if a path includes a space, the operating system may fail to behave in the manner you’d expect.

Specifically, Windows will open Explorer at the directory you specify if you type in a path at the command prompt. If you type

>c:\winnt

Explorer will open in that directory. Now, if you also have a directory called “c:\winnt stuff”, typing

>c:\winnt stuff

will not open Explorer there, because the operating system stops at “c:\winnt”. This is an operating system issue, and it will cause problems for you in GroundControl’s RunProgram function if you pass a spaced path, and suddenly find yourself looking at Explorer instead of the program you wanted to run. To fix this at the command line, make sure you include quotes around the path:

>”c:\winnt stuff”

To fix this in GroundControl, put double quotes around the path and program in the RunProgram function:

RunProgram(""c:\winnt stuff\oleview.exe"",Normal)

Here is an easy way to test your command line. If your command will runs from the run command in the start menu, it will work in the RunProgram command.


How interactive is GroundControl?

GroundControl has several different message boxes you can use. A regular Ok message box displays a custom message, and waits for someone to clear it. An Ok/Cancel message box also displays a custom message, but remembers which button the user pressed to clear it, so you can take different courses of action. Finally, an input message box will ask a custom question, and save whatever the user typed in a variable , which you can use as a parameter to any function that GroundControl has.


Can GroundControl read the Clipboard?

Sure, as long as the contents are in text form. Use the GetClipBoard function to pull the text into a variable . You can use GroundControl to control the transfer of data that is not text, by making one program dump its contents to the Clipboard, and have another paste from the Clipboards. This way, GroundControl doesn’t have to know what’s actually in the Clipboard.


What kind of directory searches are supported?

GroundControl can check for the existence of a file in a fully specified directory, using the FileExist function, which returns True if the file is there, and False if not. This function does support wildcards, so you can search for any “*.doc” files or “a???.bmp” files, etc.

A more powerful search is the FindFile function, which can search all directories in the system path for the file you want, and also tells you where it found it. Unfortunately, this function does not support wildcards, so you must know exactly what you are looking for.


What are all those SendKeys functions?

Anywhere you can type text in Windows, you can use GroundControl to send that text. The catch is that when you type, you have to make sure you have the correct window in front and active. You can use SendKeys to send Alt-F4, or any other menu commands that you care to.

You can also use SendKeys to fill in a dialog box, but you must ensure that the caret is in the right control, that is, that the correct control has focus. When done filling out the box, send Tabs to move around to the Ok button, and send an Enter key.

Be aware that certain keys are actually sent as two key strokes. An “a” is simply sent as an “a”, but an “A” is sent as a “SHIFT” followed by an “a”. This might be obvious when you are physically typing the “a” or “A”, but when you are sending the string inside of a variable , like “Hello Bob”, you are actually sending 11 keystrokes, not 9.

You can send any environment variable, send the current time or any part of it, send the contents of any variable, or the contents of a text file, and you can also send the results of an input message box, after asking the user for a string.

The trickiest part about sending keys is making sure the correct window gets the intended keystrokes. If you are running programs with the intent of sending them keys, make sure you put in a delay so the other program can get started before you stream off a bunch of text. If you don’t want to activate the other window to send it keys, you can call SendInputToWindow or SendKeysToWindow , and save the extra step.

Be aware that there are some special keys in the SendKeys command set, which may require the use of braces as described in the SendKeys Overview in the help file. To send the following exactly as it appears to Notepad from GroundControl:

%F

You would use the following syntax:

SendKeysToWindow("Untitled - Notepad","SendKeys{(}"{%}F"{)}")

This technique can be used to have GroundControl scripts create other GroundControl scripts dynamically!


What about screen savers?

In Windows NT, every process runs independently of the others, and screen savers are separate processes. This means that a screen saver will not interfere with GroundControl. However, if your GroundControl script has message boxes that require someone to clear them, you won’t see them if the screen saver is active.


MouseTrack Utility

MouseTrack mouse position utility.  MouseTrack displays the x y corrdinates of the mouse pointer.  This utiliy is useful for determining parameters for MouseClickScreen and MouseDblClickScreen .

The MouseTrack.exe is installed in the same directory as gc.exe